Selaa lähdekoodia

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.
Guillem Jover 14 vuotta sitten
vanhempi
commit
e6b71eb023
2 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 1 0
      debian/changelog
  2. 1 1
      utils/start-stop-daemon.c

+ 1 - 0
debian/changelog

@@ -33,6 +33,7 @@ dpkg (1.16.2) UNRELEASED; urgency=low
     Thanks to Colin Watson <cjwatson@ubuntu.com>.
   * Add new deb-origin.5 man page. Closes: #608884
     Thanks to Matt Kraai <kraai@ftbfs.org>.
+  * 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

+ 1 - 1
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);