Explorar o código

s-s-d: Keep retrying even if the daemon removed the pidfile

Closes: #460903
Guillem Jover %!s(int64=18) %!d(string=hai) anos
pai
achega
b6a8bc8f16
Modificáronse 3 ficheiros con 14 adicións e 1 borrados
  1. 5 0
      ChangeLog
  2. 3 0
      debian/changelog
  3. 6 1
      utils/start-stop-daemon.c

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-01-16  Guillem Jover  <guillem@debian.org>
+
+	* utils/start-stop-daemon.c (do_pidfile): Cache pid value over
+	multiple calls.
+
 2008-01-16  Guillem Jover  <guillem@debian.org>
 
 	* utils/start-stop-daemon.c: Fix indentation.

+ 3 - 0
debian/changelog

@@ -6,6 +6,9 @@ dpkg (1.14.16) UNRELEASED; urgency=low
   * Do not warn about unrecognized Homepage field in binary package stanzas
     in dpkg-genchanges and dpkg-source. Closes: #460309
   * Do not use the enoent helper binary, and use perl POSIX module instead.
+  * Keep checking for the process when start-stop-daemon is called with
+    --retry even if the daemon removed the pidfile. Closes: #460903
+    Thanks to Justin Pryzby for the analysis.
 
   [ Frank Lichtenheld ]
   * Make the -L option of dpkg-parsechangelog actually work (it's

+ 6 - 1
utils/start-stop-daemon.c

@@ -848,7 +848,12 @@ static void
 do_pidfile(const char *name)
 {
 	FILE *f;
-	pid_t pid;
+	static pid_t pid = 0;
+
+	if (pid) {
+		check(pid);
+		return;
+	}
 
 	f = fopen(name, "r");
 	if (f) {