SHA256
1
0
forked from pool/systemd
systemd/0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
Robert Milasan ef894ec214 Accepting request 178446 from home:elvigia:branches:Base:System
- 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
 fixes :
 * systemd-journald[347]: Failed to set ACL on 
 /var/log/journal/11d90b1c0239b5b2e38ed54f513722e3/user-1000.journal, 
 ignoring: Invalid argument
- 006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
  systemctl disable should remove dangling symlinks.
- 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
  alien childs are reported as alive when they are really dead.

- 0004-journald-DO-recalculate-the-ACL-mask-but-only-if-it-.patch
 fixes :
 * systemd-journald[347]: Failed to set ACL on 
 /var/log/journal/11d90b1c0239b5b2e38ed54f513722e3/user-1000.journal, 
 ignoring: Invalid argument
- 006-systemctl-core-allow-nuking-of-symlinks-to-removed-u.patch
  systemctl disable should remove dangling symlinks.
- 0008-service-don-t-report-alien-child-as-alive-when-it-s-.patch
  alien childs are reported as alive when they are really dead.

OBS-URL: https://build.opensuse.org/request/show/178446
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=390
2013-06-11 09:22:26 +00:00

33 lines
1.2 KiB
Diff

From 3608595751f62bbc6d37eb78b746ab6fecfa2d45 Mon Sep 17 00:00:00 2001
From: Ross Lagerwall <rosslagerwall@gmail.com>
Date: Sun, 9 Jun 2013 17:28:44 +0100
Subject: [PATCH 8/8] service: don't report alien child as alive when it's not
When a sigchld is received from an alien child, main_pid is set to
0 then service_enter_running calls main_pid_good to check if the
child is running. This incorrectly returned true because
kill(main_pid, 0) would return >= 0.
This fixes an error where a service would die and the cgroup would
become empty but the service would still report as active (running).
---
src/core/service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/service.c b/src/core/service.c
index e110a41..973bd03 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1865,7 +1865,7 @@ static int main_pid_good(Service *s) {
/* If it's an alien child let's check if it is still
* alive ... */
- if (s->main_pid_alien)
+ if (s->main_pid_alien && s->main_pid > 0)
return kill(s->main_pid, 0) >= 0 || errno != ESRCH;
/* .. otherwise assume we'll get a SIGCHLD for it,
--
1.8.1.4