25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Halt ejabberd if a command in CTL_ON_ fails during ejabberd startup

See processone/ejabberd-contrib#97
This commit is contained in:
Badlop 2023-06-13 00:39:05 +02:00
parent dcc8149f58
commit ffbcf19156

View File

@ -283,6 +283,12 @@ post_waiter_loop()
TAIL=${LIST#* ; } TAIL=${LIST#* ; }
echo ":> ejabberdctl $HEAD" echo ":> ejabberdctl $HEAD"
$0 $HEAD $0 $HEAD
ctlstatus=$?
if [ $ctlstatus -ne 0 ] ; then
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null
exit $ctlstatus
fi
[ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL [ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL
} }