mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
@@ -13,29 +13,8 @@ fi
|
|||||||
service_action() {
|
service_action() {
|
||||||
SERVICES=$TOWER_SERVICES
|
SERVICES=$TOWER_SERVICES
|
||||||
|
|
||||||
# When determining whether mongod is required, postgres is required. The
|
|
||||||
# following ensures mongod is started after postgres, and stopped before
|
|
||||||
# postgres.
|
|
||||||
case ${1} in
|
|
||||||
start|status)
|
|
||||||
SERVICES="$SERVICES mongod"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
SERVICES="mongod $SERVICES"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
for svc in ${SERVICES}; do
|
for svc in ${SERVICES}; do
|
||||||
|
|
||||||
# Determine whether mongod is needed
|
|
||||||
if [[ ${svc} == mongod ]]; then
|
|
||||||
tower-manage uses_mongo --local 2> /dev/null >/dev/null
|
|
||||||
# if mongod is not required, break
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
service ${svc} $1
|
service ${svc} $1
|
||||||
this_return=$?
|
this_return=$?
|
||||||
if [ $this_return -gt $worst_return ]; then
|
if [ $this_return -gt $worst_return ]; then
|
||||||
@@ -43,7 +22,7 @@ service_action() {
|
|||||||
fi
|
fi
|
||||||
# Allow supervisor time to cleanup child pids (ubuntu only)
|
# Allow supervisor time to cleanup child pids (ubuntu only)
|
||||||
if [[ ${svc} == supervisor* && ${1} == stop && -e /etc/debian_version ]]; then
|
if [[ ${svc} == supervisor* && ${1} == stop && -e /etc/debian_version ]]; then
|
||||||
S_PID=$(pidof -x supervisord)
|
S_PID=$(pidof -x supervisord)
|
||||||
echo "Waiting to allow supervisor time to cleanup ... pid ${S_PID}"
|
echo "Waiting to allow supervisor time to cleanup ... pid ${S_PID}"
|
||||||
if [ "${S_PID}" ]; then
|
if [ "${S_PID}" ]; then
|
||||||
i=0
|
i=0
|
||||||
@@ -76,22 +55,22 @@ case "$1" in
|
|||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
start)
|
start)
|
||||||
echo "Starting Tower"
|
echo "Starting Tower"
|
||||||
service_action start
|
service_action start
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo "Stopping Tower"
|
echo "Stopping Tower"
|
||||||
service_action stop
|
service_action stop
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
echo "Restarting Tower"
|
echo "Restarting Tower"
|
||||||
service_action stop
|
service_action stop
|
||||||
service_action start
|
service_action start
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
echo "Showing Tower Status"
|
echo "Showing Tower Status"
|
||||||
service_action status
|
service_action status
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage
|
usage
|
||||||
worst_return=1
|
worst_return=1
|
||||||
|
|||||||
Reference in New Issue
Block a user