2
2
3
3
4
4
LOGFILE=" /dev/null"
5
- COMPONENTS=" st2actionrunner st2api st2auth st2garbagecollector st2notifier st2resultstracker "
6
- COMPONENTS+=" st2rulesengine st2sensorcontainer st2web mistral mistral-api"
5
+ COMPONENTS=" st2actionrunner st2api st2auth st2garbagecollector st2notifier st2resultstracker st2rulesengine st2sensorcontainer mistral"
7
6
STANCONF=" /etc/st2/st2.conf"
8
- WEBUI_PORT=${WEBUI_PORT:- 8080}
9
7
10
8
# Ensure global environment is sourced if exists
11
9
# Does not happen consistently with all OSes we support.
@@ -76,8 +74,10 @@ function st2stop() {
76
74
function service_manager() {
77
75
if [ -d /run/systemd/system ]; then
78
76
systemctl " ${2} " " ${1} "
79
- elif command -v service 2> /dev/null; then
77
+ elif command -v service > /dev/null 2>&1 ; then
80
78
service " ${1} " " ${2} "
79
+ elif [ -x /etc/init.d/${1} ]; then
80
+ /etc/init.d/${1} " ${2} "
81
81
else
82
82
echo -e " \e[31mError: Unsupported service manager in the system! \e[0m\n"
83
83
exit 1
@@ -140,15 +140,10 @@ function clean_logs() {
140
140
141
141
function getpids() {
142
142
echo " ##### st2 components status #####"
143
+ COMPONENTS=${COMPONENTS/ mistral/ mistral-server mistral-api}
143
144
144
145
for COM in ${COMPONENTS} ; do
145
- if [[ " ${COM} " == " st2web" && -z " ${ST2_DISABLE_HTTPSERVER} " ]]; then
146
- PID=` ps ax | grep -v grep | egrep " SimpleHTTPServer $WEBUI_PORT \$ " | awk ' {print $1}' `
147
- elif [[ " ${COM} " == " mistral" ]]; then
148
- PID=` ps ax | grep -v grep | grep -v postgres | grep " ${COM} " | awk ' {print $1}' `
149
- else
150
- PID=` ps ax | grep -v grep | grep -v st2ctl | grep " ${COM} " | awk ' {print $1}' `
151
- fi
146
+ PID=` ps ax | grep -v grep | grep -v st2ctl | grep " ${COM} " | awk ' {print $1}' `
152
147
153
148
if [[ ! -z ${PID} ]]; then
154
149
for p in ${PID} ; do
@@ -172,7 +167,7 @@ case ${1} in
172
167
st2stop
173
168
;;
174
169
restart)
175
- must_be_root
170
+ must_be_root
176
171
st2stop
177
172
sleep 1
178
173
st2start
0 commit comments