[Pkg-sysvinit-devel] Bug#825870: sysvinit-utils: Second stop command does not use process matchers name and pidfile

Andreas Henriksson andreas at fatal.se
Tue May 31 15:40:48 UTC 2016


Hello Steven Roose.

On Tue, May 31, 2016 at 02:15:10AM +0200, Steven Roose wrote:
[...]
> The daemon does not make it's own pidfile, so I added following relevant variables:
> PIDFILE=/pidfile
> START_ARGS=" --make-pidfile"
> STOP_ARGS=" --remove-pidfile"
[...]
> --- a/debian/init-d-script
> +++ b/debian/init-d-script
> @@ -95,7 +95,7 @@ do_stop_cmd() {
>  	# sleep for some time.
>  	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
>  	    $STOP_ARGS \
> -	    --exec $DAEMON
> +	    ${PIDFILE:+--pidfile ${PIDFILE}} --name $NAME --exec $DAEMON  
>  	[ "$?" = 2 ] && return 2
>  	# Many daemons don't delete their pidfiles when they exit.
>  	rm -f $PIDFILE
[...]

While I think your patch looks good please note that there's no
point in using STOP_ARGS=" --remove-pidfile" given the last quoted
line above which will unconditionally remove any pidfile.

The workaround for your issue is thus very simple. Just drop
STOP_ARGS=" --remove-pidfile"

Hope this helps.

Regards,
Andreas Henriksson



More information about the Pkg-sysvinit-devel mailing list