Actually, we have to check $1 as well - $UPSTART_EVENT is not reset if the stop command is by exit, so it still contains "runlevel" because that's what started the job.
if [ "${UPSTART_EVENT}" = "runlevel" -a "$1" != "S" ] then exit 100 fi
Seems right
Actually, we have to check $1 as well - $UPSTART_EVENT is not reset if the stop command is by exit, so it still contains "runlevel" because that's what started the job.
if [ "${UPSTART_EVENT}" = "runlevel" -a "$1" != "S" ]
then
exit 100
fi
Seems right