Fix for - st2ctl environment variables
# See the License for the specific language governing permissions and
# limitations under the License.
-LOGFILE="/dev/null"
COMPONENTS="st2actionrunner st2api st2stream st2auth st2garbagecollector st2notifier st2resultstracker st2rulesengine st2sensorcontainer st2chatops mistral"
-STANCONF="/etc/st2/st2.conf"
+ST2_CONFIG="/etc/st2/st2.conf"
# Ensure global environment is sourced if exists
# Does not happen consistently with all OSes we support.
[ -r /etc/environment ] && . /etc/environment
+# load in environment to allow override of COMPONENTS and ST2_CONFIG above
+# Ubuntu/Debian
+[ -r /etc/default/st2ctl ] && . /etc/default/st2ctl
+# RHEL/CentOS
+[ -r /etc/sysconfig/st2ctl ] && . /etc/sysconfig/st2ctl
+
function print_usage() {
echo "Usage: st2ctl {start, stop, restart, status}"
@@ -162,13 +167,13 @@ function register_content() {
REGISTER_FLAGS=${flags}
fi
- echo "Registering content...[flags = --config-file ${STANCONF} ${REGISTER_FLAGS}]"
- st2-register-content --config-file ${STANCONF} ${REGISTER_FLAGS}
+ echo "Registering content...[flags = --config-file ${ST2_CONFIG} ${REGISTER_FLAGS}]"
+ st2-register-content --config-file ${ST2_CONFIG} ${REGISTER_FLAGS}
}
function clean_db() {
echo "Dropping st2 Database..."
- /opt/stackstorm/st2/bin/st2-cleanup-db --config-file ${STANCONF}
+ /opt/stackstorm/st2/bin/st2-cleanup-db --config-file ${ST2_CONFIG}
}
function clean_logs() {
