Browse Source

s-s-d: Do not abort on --stop when only pid or ppid options are specified

When running with «--stop» and only pid or ppid as matching options,
start-stop-daemon aborts with a "no match option" error.

«pid» and «ppid» are proper matching options, so they should be enough
to proceed.

Missed in commits 80de58344cb38ab085ca2c7808f4f7b3be1d2422 and
3fabf94e0b5fe1bcdea26fecee1c87e74fab98b2.

Closes: #763767

Signed-off-by: Guillem Jover <guillem@debian.org>
Christos Trochalakis 11 years ago
parent
commit
8f686fbeb1
2 changed files with 6 additions and 0 deletions
  1. 2 0
      debian/changelog
  2. 4 0
      utils/start-stop-daemon.c

+ 2 - 0
debian/changelog

@@ -60,6 +60,8 @@ dpkg (1.17.14) UNRELEASED; urgency=low
       Based on a patch by Nir Soffer <nirs@hyperms.com>. Closes: #686420
     - Make sure the pidfile is always created with a 022 umask.
       Reported by Will Conley <willconley3@gmail.com>. Closes: #760222
+    - Do not abort on --stop when only --pid or --ppid options are specified.
+      Thanks to Christos Trochalakis <yatiohi@ideopolis.gr>. Closes: #763767
 
   [ Raphaël Hertzog ]
   * Explain better in deb-triggers(5) why interest/activate-noawait should be

+ 4 - 0
utils/start-stop-daemon.c

@@ -2041,6 +2041,10 @@ run_stop_schedule(void)
 		set_what_stop(execname);
 	else if (pidfile)
 		sprintf(what_stop, "process in pidfile '%.200s'", pidfile);
+	else if (match_pid > 0)
+		sprintf(what_stop, "process with pid %d", match_pid);
+	else if (match_ppid > 0)
+		sprintf(what_stop, "process(es) with parent pid %d", match_ppid);
 	else if (userspec)
 		sprintf(what_stop, "process(es) owned by '%.200s'", userspec);
 	else