]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
service: only fail notify services on empty cgroup during start
authorJouke Witteveen <j.witteveen@gmail.com>
Thu, 24 Nov 2016 20:05:47 +0000 (21:05 +0100)
committerJouke Witteveen <j.witteveen@gmail.com>
Tue, 29 Nov 2016 09:34:33 +0000 (10:34 +0100)
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.

src/core/service.c

index 180854b57cf345576175ee7d158d32678c7e1726..39b3589e6ba0b52a42a699e34453e6661d8e2b20 100644 (file)
@@ -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.");