summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJouke Witteveen <j.witteveen@gmail.com>2016-11-24 21:05:47 +0100
committerJouke Witteveen <j.witteveen@gmail.com>2016-11-29 10:34:33 +0100
commit71e529fcf18c00e4dd51fb46f7f289dc5eb11fbd (patch)
tree2b02d03f041b75edb89b81ec9833e015e81911a9 /src
parent920ec31b5ffeb8695bef68e0dc082c0fc22965d3 (diff)
service: only fail notify services on empty cgroup during start
We stay in the SERVICE_START while no READY=1 notification message has been received. When we are in the SERVICE_START_POST state, we have already received a ready notification. Hence we should not fail when the cgroup becomes empty in that state.
Diffstat (limited to 'src')
-rw-r--r--src/core/service.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/service.c b/src/core/service.c
index 180854b57c..39b3589e6b 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2579,11 +2579,16 @@ static void service_notify_cgroup_empty_event(Unit *u) {
* SIGCHLD for. */
case SERVICE_START:
- case SERVICE_START_POST:
- if (s->type == SERVICE_NOTIFY)
+ if (s->type == SERVICE_NOTIFY) {
/* No chance of getting a ready notification anymore */
service_enter_signal(s, SERVICE_FINAL_SIGTERM, SERVICE_FAILURE_PROTOCOL);
- else if (s->pid_file_pathspec) {
+ break;
+ }
+
+ /* Fall through */
+
+ case SERVICE_START_POST:
+ if (s->pid_file_pathspec) {
/* Give up hoping for the daemon to write its PID file */
log_unit_warning(u, "Daemon never wrote its PID file. Failing.");