From ef76a663bcc03d4cc9dd1ef05c800f208e26d0ed Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Mon, 22 Mar 2021 11:34:41 -0500 Subject: stop namespaced services with specified pids The previous fix excludes PIDs of processes running in a different namespace regardless of whether the PID has been explicitly stored in a PID file mentioned in the --pidfile parameter. The correct behavior is to only exclude the pid if it is not stored in a pidfile. X-Gentoo-Bug: 776010 X-Gentoo-Bug-URL: https://bugs.gentoo.org/776010 --- src/librc/librc-daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 863e80d1..0a0fbb8f 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -160,7 +160,7 @@ rc_find_pids(const char *exec, const char *const *argv, uid_t uid, pid_t pid) proc_ns[0] = '\0'; } free(buffer); - if (strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns)) + if (pid == 0 && strlen(my_ns) && strlen (proc_ns) && strcmp(my_ns, proc_ns)) continue; if (uid) { xasprintf(&buffer, "/proc/%d", p); -- cgit v1.2.3