[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#157305: start-stop-daemon: spurious error message when using --pidfile and --retry together



tags 157305 +patch
thanks

    Hi,

 This is a follow-up to an old start-stop-daemon bug, #157305.


Tobias Burnus <tobias.burnus@physik.fu-berlin.de> - Mon, Aug 19, 2002:
>  /sbin/start-stop-daemon: warning: failed to kill 12180: No such process
> if there is a proccess that is killed.
> If no killable process is there. Nothing is outputed.
> The output failed to kill 12180 is strange since the process had been killed.
> /sbin/start-stop-daemon --stop --pidfile /var/run/zedv_hunter.pid --retry 5 --signal TERM --quiet --oknodo
> If I remove the --retry 5 it works.

Thomas Hood <jdthood@yahoo.co.uk> - Tue, Oct 01, 2002:
> I was able to reproduce this bug.  Simply create a process,
> put its pid in a file, and call start-stop-daemon:
>    sudo start-stop-daemon --stop --pidfile /tmp/pidfile --retry 5
> The result is the error message:
>     start-stop-daemon: warning: failed to kill 2679: No such process
> which is presumably generated on the second pass of the retry sequence.

 A check is missing in ssd when the process is only pointed by its pid,
 ssd doesn't check that the pid is running.  The attached patch fixes
 this problem.

 A temporary workaround is to use --name or --exec in the
 start-stop-daemon command line.

   Regards,

-- 
Loïc Minier <lool@dooz.org>
diff -ur dpkg-1.10.23-orig/utils/start-stop-daemon.c dpkg-1.10.23/utils/start-stop-daemon.c
--- dpkg-1.10.23-orig/utils/start-stop-daemon.c	2004-07-19 20:56:49.000000000 +0200
+++ dpkg-1.10.23/utils/start-stop-daemon.c	2004-08-28 21:00:33.000000000 +0200
@@ -734,7 +734,8 @@
 		return;
 	if (start && !pid_is_running(pid))
 		return;
-	push(&found, pid);
+	if (stop && pid_is_running(pid))
+		push(&found, pid);
 }
 
 static void

Reply to: