]> err.no Git - dpkg/commitdiff
s-s-d: Make --quiet silence --test
authorGuillem Jover <guillem@debian.org>
Wed, 16 Jan 2008 06:12:20 +0000 (08:12 +0200)
committerGuillem Jover <guillem@debian.org>
Wed, 16 Jan 2008 07:15:04 +0000 (09:15 +0200)
Closes: #367998
ChangeLog
debian/changelog
utils/start-stop-daemon.c

index da2892b5d075c88d8083e397cd792016e8d4125d..44bd23f868cda25355daf08ac734246655a28efd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-16  Guillem Jover  <guillem@debian.org>
+
+       * utils/start-stop-daemon.c (do_stop): Do not print messages when
+       running on quiet and test modes.
+       (run_stop_schedule): Likewise.
+       (main): Likewise.
+
 2008-01-16  Guillem Jover  <guillem@debian.org>
 
        * utils/start-stop-daemon.c (do_pidfile): Cache pid value over
index 0363c8d7827d266fd8aea7f4615b4e32e33eb46e..987616e51dcf7016a9bb65e684b9a8b4d88eafdb 100644 (file)
@@ -9,6 +9,7 @@ dpkg (1.14.16) UNRELEASED; urgency=low
   * 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.
+  * Make --quiet silence --test in start-stop-daemon. Closes: #367998
 
   [ Frank Lichtenheld ]
   * Make the -L option of dpkg-parsechangelog actually work (it's
index 24537d9100f2882903d31c906f4969087635c3cc..a74f7c740cfea660751aae459e6d353d13dc2f0a 100644 (file)
@@ -1078,8 +1078,9 @@ do_stop(int signal_nr, int quietmode, int *n_killed, int *n_notkilled, int retry
 
        for (p = found; p; p = p->next) {
                if (testmode) {
-                       printf("Would send signal %d to %d.\n",
-                              signal_nr, p->pid);
+                       if (quietmode <= 0)
+                               printf("Would send signal %d to %d.\n",
+                                      signal_nr, p->pid);
                        (*n_killed)++;
                } else if (kill(p->pid, signal_nr) == 0) {
                        push(&killed, p->pid);
@@ -1117,7 +1118,8 @@ run_stop_schedule(void)
 
        if (testmode) {
                if (schedule != NULL) {
-                       printf("Ignoring --retry in test mode\n");
+                       if (quietmode <= 0)
+                               printf("Ignoring --retry in test mode\n");
                        schedule = NULL;
                }
        }
@@ -1318,7 +1320,7 @@ main(int argc, char **argv)
                        printf("%s already running.\n", execname ? execname : "process");
                exit(exitnodo);
        }
-       if (testmode) {
+       if (testmode && quietmode <= 0) {
                printf("Would start %s ", startas);
                while (argc-- > 0)
                        printf("%s ", *argv++);
@@ -1334,8 +1336,9 @@ main(int argc, char **argv)
                if (nicelevel)
                        printf(", and add %i to the priority", nicelevel);
                printf(".\n");
-               exit(0);
        }
+       if (testmode)
+               exit(0);
        if (quietmode < 0)
                printf("Starting %s...\n", startas);
        *--argv = startas;