Your daemon does not create a pidfile, and neither does start-stop-daemon
. I guess the first line
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
does nothing, because the --pidfile
process selection criterion is never satisfied, but the second line
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
kills the daemon with SIGKILL
, because here the --pidfile
option is not included.
You should fix your daemon to create a pidfile.