Package: sysvinit-utils Version: 2.88dsf-59 Severity: normal Tags: patch Dear Maintainer,
*** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? I used /etc/init.d/skeleton to make a script for a daemon. 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" NAME= DAEMON= * What exactly did you do (or not do) that was effective (or ineffective)? /etc/init.d/mydaemon start /etc/init.d/mydaemon stop * What was the outcome of this action? The following error message: "start-stop-daemon: --remove-pidfile requires --pidfile" * What outcome did you expect instead? The daemon would be stopped. -- System Information: Debian Release: 8.4 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=locale: Cannot set LC_ALL to default locale: No such file or directory UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages sysvinit-utils depends on: ii libc6 2.19-18+deb8u4 ii libselinux1 2.3-2 ii startpar 0.59-3 sysvinit-utils recommends no packages. Versions of packages sysvinit-utils suggests: pn bootlogd <none> pn sash <none> -- debconf information excluded
>From db2dcfa27188f4ba983f7bf74564ee942d8464b9 Mon Sep 17 00:00:00 2001 From: Steven Roose <stevenro...@gmail.com> Date: Tue, 31 May 2016 01:56:44 +0200 Subject: [PATCH] Fix problem in do_stop_cmd() of init-d-script The second stop command does not contain the --name and --pidfile identifiers. --- debian/init-d-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/init-d-script b/debian/init-d-script index 334dc32..3b2a51d 100755 --- 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 -- 1.9.1
>From db2dcfa27188f4ba983f7bf74564ee942d8464b9 Mon Sep 17 00:00:00 2001 From: Steven Roose <stevenro...@gmail.com> Date: Tue, 31 May 2016 01:56:44 +0200 Subject: [PATCH] Fix problem in do_stop_cmd() of init-d-script The second stop command does not contain the --name and --pidfile identifiers. --- debian/init-d-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/init-d-script b/debian/init-d-script index 334dc32..3b2a51d 100755 --- 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 -- 1.9.1