From b6a8bc8f16e208e47416102ccdb67149bb4ddc1b Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 16 Jan 2008 07:55:32 +0200 Subject: [PATCH] s-s-d: Keep retrying even if the daemon removed the pidfile Closes: #460903 --- ChangeLog | 5 +++++ debian/changelog | 3 +++ utils/start-stop-daemon.c | 7 ++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 376cb57f..da2892b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-16 Guillem Jover + + * utils/start-stop-daemon.c (do_pidfile): Cache pid value over + multiple calls. + 2008-01-16 Guillem Jover * utils/start-stop-daemon.c: Fix indentation. diff --git a/debian/changelog b/debian/changelog index a8992a7e..0363c8d7 100644 --- a/debian/changelog +++ b/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 diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 30bba748..24537d91 100644 --- a/utils/start-stop-daemon.c +++ b/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) { -- 2.39.5