add quiet parameter to run_stop_schedule
This commit is contained in:
parent
17b5cc78d3
commit
382efdbfcb
@ -298,7 +298,7 @@ int do_stop(const char *applet, const char *exec, const char *const *argv,
|
|||||||
int run_stop_schedule(const char *applet,
|
int run_stop_schedule(const char *applet,
|
||||||
const char *exec, const char *const *argv,
|
const char *exec, const char *const *argv,
|
||||||
pid_t pid, uid_t uid,
|
pid_t pid, uid_t uid,
|
||||||
bool test, bool progress)
|
bool test, bool progress, bool quiet)
|
||||||
{
|
{
|
||||||
SCHEDULEITEM *item = TAILQ_FIRST(&schedule);
|
SCHEDULEITEM *item = TAILQ_FIRST(&schedule);
|
||||||
int nkilled = 0;
|
int nkilled = 0;
|
||||||
@ -409,10 +409,11 @@ int run_stop_schedule(const char *applet,
|
|||||||
|
|
||||||
if (progressed)
|
if (progressed)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
if (nrunning == 1)
|
if (! quiet)
|
||||||
eerror("%s: %d process refused to stop", applet, nrunning);
|
if (nrunning == 1)
|
||||||
else
|
eerror("%s: %d process refused to stop", applet, nrunning);
|
||||||
eerror("%s: %d process(es) refused to stop", applet, nrunning);
|
else
|
||||||
|
eerror("%s: %d process(es) refused to stop", applet, nrunning);
|
||||||
|
|
||||||
return -nrunning;
|
return -nrunning;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,6 @@ int do_stop(const char *applet, const char *exec, const char *const *argv,
|
|||||||
int run_stop_schedule(const char *applet,
|
int run_stop_schedule(const char *applet,
|
||||||
const char *exec, const char *const *argv,
|
const char *exec, const char *const *argv,
|
||||||
pid_t pid, uid_t uid,
|
pid_t pid, uid_t uid,
|
||||||
bool test, bool progress);
|
bool test, bool progress, bool quiet);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -657,7 +657,7 @@ int main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
parse_schedule(applet, NULL, sig);
|
parse_schedule(applet, NULL, sig);
|
||||||
i = run_stop_schedule(applet, exec, (const char *const *)margv,
|
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)
|
if (i < 0)
|
||||||
/* We failed to stop something */
|
/* We failed to stop something */
|
||||||
|
@ -755,7 +755,7 @@ int main(int argc, char **argv)
|
|||||||
if (exiting) {
|
if (exiting) {
|
||||||
syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
|
syslog(LOG_INFO, "stopping %s, pid %d", exec, child_pid);
|
||||||
nkilled = run_stop_schedule(applet, exec, NULL, child_pid,
|
nkilled = run_stop_schedule(applet, exec, NULL, child_pid,
|
||||||
0, false, false);
|
0, false, false, true);
|
||||||
if (nkilled > 0)
|
if (nkilled > 0)
|
||||||
syslog(LOG_INFO, "killed %d processes", nkilled);
|
syslog(LOG_INFO, "killed %d processes", nkilled);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user