mirror of
https://github.com/ansible/awx.git
synced 2026-05-12 11:57:37 -02:30
Fix up init script to use service command, preserve the worst return
code and use that as the exit status
This commit is contained in:
@@ -26,10 +26,15 @@ fi
|
|||||||
|
|
||||||
service_action() {
|
service_action() {
|
||||||
for svc in ${SERVICES[@]}; do
|
for svc in ${SERVICES[@]}; do
|
||||||
/etc/init.d/${svc} $1
|
service ${svc} $1
|
||||||
|
this_return=$?
|
||||||
|
if [ $this_return -gt $worst_return ]; then
|
||||||
|
worst_return=$this_return
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
worst_return=0
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo "Starting Tower"
|
echo "Starting Tower"
|
||||||
@@ -51,3 +56,4 @@ case "$1" in
|
|||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|restart|status}"
|
echo "Usage: $0 {start|stop|restart|status}"
|
||||||
esac
|
esac
|
||||||
|
exit $worst_return
|
||||||
|
|||||||
Reference in New Issue
Block a user