From: Guillem Jover Date: Wed, 16 Jan 2008 06:12:20 +0000 (+0200) Subject: s-s-d: Make --quiet silence --test X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a1da85bed792442adfd74c66bf9bd369ce4c4e6;p=dpkg s-s-d: Make --quiet silence --test Closes: #367998 --- diff --git a/ChangeLog b/ChangeLog index da2892b5..44bd23f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-01-16 Guillem Jover + + * 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 * utils/start-stop-daemon.c (do_pidfile): Cache pid value over diff --git a/debian/changelog b/debian/changelog index 0363c8d7..987616e5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 24537d91..a74f7c74 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -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;