From: Chris Paulson-Ellis Date: Thu, 2 Feb 2012 17:32:05 +0000 (+0000) Subject: util: prevent daemon-reload from reaping service processes. X-Git-Tag: v40~12 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec3f9b53f882623e6572258ba15234b1ee108b7f;p=systemd util: prevent daemon-reload from reaping service processes. The reaping of generator processes run as part of a daemon-reload should not call waitid(PID_ALL). The waitid() call in execute_directory() is intended only to reap the executed processes, but if a service process exits at about the same time as a daemon-reload, then that service process is reaped as well, preventing it from being reaped in the proper place in manager_dispatch_sigchld(). Fixes https://bugs.freedesktop.org/show_bug.cgi?id=43625 --- diff --git a/src/util.c b/src/util.c index 58a0aeba..11f77abd 100644 --- a/src/util.c +++ b/src/util.c @@ -4623,11 +4623,12 @@ void execute_directory(const char *directory, DIR *d, char *argv[]) { } while (!hashmap_isempty(pids)) { + pid_t pid = PTR_TO_UINT(hashmap_first_key(pids)); siginfo_t si; char *path; zero(si); - if (waitid(P_ALL, 0, &si, WEXITED) < 0) { + if (waitid(P_PID, pid, &si, WEXITED) < 0) { if (errno == EINTR) continue;