The following commit has been merged in the master branch:
commit e6b71eb0234e72933c1630142f6e68ddd3ae1de4
Author: Guillem Jover <[email protected]>
Date:   Sat Nov 12 06:06:46 2011 +0100

    s-s-d: Always check if the pid is active on --start and --status
    
    Otherwise the code was assuming the pid was active when it was being
    specified by --pidfile on --status.

diff --git a/debian/changelog b/debian/changelog
index 5f36e5c..9844d1c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,7 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     Thanks to Colin Watson <[email protected]>.
   * Add new deb-origin.5 man page. Closes: #608884
     Thanks to Matt Kraai <[email protected]>.
+  * Return correct status on start-stop-daemon --status when using --pidfile.
 
   [ Raphaƫl Hertzog ]
   * Update Dpkg::Shlibs to look into multiarch paths when cross-building
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 03a7b57..33d191c 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -1220,7 +1220,7 @@ pid_check(pid_t pid)
                return status_dead;
        if (cmdname && !pid_is_cmd(pid, cmdname))
                return status_dead;
-       if (action == action_start && !pid_is_running(pid))
+       if (action != action_stop && !pid_is_running(pid))
                return status_dead;
 
        pid_list_push(&found, pid);

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to