diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2017-09-06 16:43:28 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2017-09-06 17:22:35 -0500 |
commit | 382efdbfcb99703d03211efacd800c9575e64230 (patch) | |
tree | 028850d6071496eb881da6ef51e8013b3ab7548c /src/rc | |
parent | 17b5cc78d35dc5fe4904e5951715c3e0d07d6343 (diff) |
add quiet parameter to run_stop_schedule
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/rc-schedules.c | 11 | ||||
-rw-r--r-- | src/rc/rc-schedules.h | 2 | ||||
-rw-r--r-- | src/rc/start-stop-daemon.c | 2 | ||||
-rw-r--r-- | src/rc/supervise-daemon.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/src/rc/rc-schedules.c b/src/rc/rc-schedules.c index 7eb28372..1b235a8d 100644 --- a/src/rc/rc-schedules.c +++ b/src/rc/rc-schedules.c @@ -298,7 +298,7 @@ int do_stop(const char *applet, const char *exec, const char *const *argv, int run_stop_schedule(const char *applet, const char *exec, const char *const *argv, pid_t pid, uid_t uid, - bool test, bool progress) + bool test, bool progress, bool quiet) { SCHEDULEITEM *item = TAILQ_FIRST(&schedule); int nkilled = 0; @@ -409,10 +409,11 @@ int run_stop_schedule(const char *applet, if (progressed) printf("\n"); - if (nrunning == 1) - eerror("%s: %d process refused to stop", applet, nrunning); - else - eerror("%s: %d process(es) refused to stop", applet, nrunning); + if (! quiet) + if (nrunning == 1) + eerror("%s: %d process refused to stop", applet, nrunning); + else + eerror("%s: %d process(es) refused to stop", applet, nrunning); return -nrunning; } diff --git a/src/rc/rc-schedules.h b/src/rc/rc-schedules.h index 0a10b381..a42ea0e3 100644 --- a/src/rc/rc-schedules.h +++ b/src/rc/rc-schedules.h @@ -22,6 +22,6 @@ int do_stop(const char *applet, const char *exec, const char *const *argv, int run_stop_schedule(const char *applet, const char *exec, const char *const *argv, pid_t pid, uid_t uid, - bool test, bool progress); + bool test, bool progress, bool quiet); #endif diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 4cda6102..46784b26 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -657,7 +657,7 @@ int main(int argc, char **argv) else parse_schedule(applet, NULL, sig); i = run_stop_schedule(applet, exec, (const char *const *)margv, - get_pid(applet, pidfile), uid, test, progress); + get_pid(applet, pidfile), uid, test, progress, false); if (i < 0) /* We failed to stop something */ diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index 3923dab5..a702a25c 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -755,7 +755,7 @@ int main(int argc, char **argv) if (exiting) { syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid); nkilled = run_stop_schedule(applet, exec, NULL, child_pid, - 0, false, false); + 0, false, false, true); if (nkilled > 0) syslog(LOG_INFO, "killed %d processes", nkilled); } else { |