According to the letter of the LSB:
killproc:"If a signal is specified, (...) the program is sent that signal.
Otherwise, a SIGTERM followed by a SIGKILL after an unspecified
number of seconds shall be sent."
According to start-stop-daemon manpage, that's what `--retry 5` does, with `5
seconds` being the `unspecified` of LSB, hence the `--retry 5` is only added
in the case where no signal is specified.
Closes: #650584
Reported-by: Daniel Nelson <torham@connect2.com>
Signed-off-by: Didier Raboud <odyx@debian.org>
sig=$(echo ${2:-} | sed -e 's/^-\(.*\)/\1/')
sig=$(echo $sig | sed -e 's/^SIG\(.*\)/\1/')
- if [ -z "$sig" ] || [ "$sig" = 15 ] || [ "$sig" = TERM ]; then
+ if [ "$sig" = 15 ] || [ "$sig" = TERM ]; then
is_term_sig="terminate_signal"
fi
status=0
--quiet $name_param || status="$?"
else
/sbin/start-stop-daemon --stop \
+ --retry 5 \
--quiet $name_param || status="$?"
fi
else