commit:     1732c70fb5e6d75c0d104662d06169978c00a5e8
Author:     Doug Freed <dwfreed <AT> mtu <DOT> edu>
AuthorDate: Sun Nov 19 16:05:30 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Nov 20 17:55:46 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=1732c70f

rc-schedules: if given nothing to look for, stop

This avoids trying to kill everything.

X-Gentoo-Bug: 631958
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=631958

 src/rc/rc-schedules.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/rc/rc-schedules.c b/src/rc/rc-schedules.c
index d60c2822..8f36f073 100644
--- a/src/rc/rc-schedules.c
+++ b/src/rc/rc-schedules.c
@@ -307,6 +307,9 @@ int run_stop_schedule(const char *applet,
        const char *const *p;
        bool progressed = false;
 
+       if (!(pid > 0 || exec || uid || (argv && *argv)))
+               return 0;
+
        if (exec)
                einfov("Will stop %s", exec);
        if (pid > 0)

Reply via email to