]> err.no Git - systemd/commitdiff
service: handle properly if a dbus process terminates before acquiring the dbus name
authorLennart Poettering <lennart@poettering.net>
Fri, 4 Jun 2010 19:23:00 +0000 (21:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Jun 2010 19:23:00 +0000 (21:23 +0200)
src/service.c

index c276a9a27639155d5697a9cbf44246b5a4d2791c..8b1fab785ac364e287befcbe14bfda708c501d08 100644 (file)
@@ -1963,14 +1963,18 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                         break;
 
                 case SERVICE_START:
-                        assert(s->type == SERVICE_FINISH);
+                        if (s->type == SERVICE_FINISH) {
+                                /* This was our main goal, so let's go on */
+                                if (success)
+                                        service_enter_start_post(s);
+                                else
+                                        service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
+                                break;
+                        } else {
+                                assert(s->type == SERVICE_DBUS);
 
-                        /* This was our main goal, so let's go on */
-                        if (success)
-                                service_enter_start_post(s);
-                        else
-                                service_enter_signal(s, SERVICE_FINAL_SIGTERM, false);
-                        break;
+                                /* Fall through */
+                        }
 
                 case SERVICE_RUNNING:
                         service_enter_running(s, success);