Recognize "!" flag in CTL_ON_{CREATE|START} to ignore failing commands

pull/112/head
Paweł Chmielowski 4 months ago
parent ee1d178f33
commit c0acc7aeb8

@ -278,14 +278,19 @@ post_waiter_loop()
LIST=$@ LIST=$@
HEAD=${LIST%% ; *} HEAD=${LIST%% ; *}
TAIL=${LIST#* ; } TAIL=${LIST#* ; }
echo ":> ejabberdctl $HEAD" HEAD2=${HEAD#\! *}
$0 $HEAD echo ":> ejabberdctl $HEAD2"
$0 $HEAD2
ctlstatus=$? ctlstatus=$?
if [ $ctlstatus -ne 0 ] ; then if [ $ctlstatus -ne 0 ] ; then
if [ "$HEAD" != "$HEAD2" ] ; then
echo ":> FAILURE in command '$HEAD2' !!! Ignoring result"
else
echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..." echo ":> FAILURE in command '$HEAD' !!! Stopping ejabberd..."
$0 halt > /dev/null $0 halt > /dev/null
exit $ctlstatus exit $ctlstatus
fi fi
fi
[ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL [ "$HEAD" = "$TAIL" ] || post_waiter_loop $TAIL
} }

Loading…
Cancel
Save