From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 800F21396D0 for ; Wed, 6 Sep 2017 22:33:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C436EE0DFE; Wed, 6 Sep 2017 22:33:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 90712E0DF9 for ; Wed, 6 Sep 2017 22:33:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7F435340806 for ; Wed, 6 Sep 2017 22:33:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F185D8B8C for ; Wed, 6 Sep 2017 22:33:05 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1504736555.382efdbfcb99703d03211efacd800c9575e64230.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/rc-schedules.c src/rc/rc-schedules.h src/rc/start-stop-daemon.c src/rc/supervise-daemon.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 382efdbfcb99703d03211efacd800c9575e64230 X-VCS-Branch: master Date: Wed, 6 Sep 2017 22:33:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 634be814-dda5-493a-a942-a8697a05550f X-Archives-Hash: 91f592b7a77596f9b28e9f9f599f139e commit: 382efdbfcb99703d03211efacd800c9575e64230 Author: William Hubbs gmail com> AuthorDate: Wed Sep 6 21:43:28 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Sep 6 22:22:35 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=382efdbf add quiet parameter to run_stop_schedule src/rc/rc-schedules.c | 11 ++++++----- src/rc/rc-schedules.h | 2 +- src/rc/start-stop-daemon.c | 2 +- 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 {