chiark / gitweb /
service: properly handle if the main process is down and we wait for the cgroup to...
[elogind.git] / src / service.c
index fabb71ca978f23453aac4c4bec7cad1db28a7643..94f2f37afc1c15ce74da44ccac4b4ed71bfed7f7 100644 (file)
@@ -2579,6 +2579,13 @@ static void service_cgroup_notify_event(Unit *u) {
 
                 break;
 
+        case SERVICE_FINAL_SIGTERM:
+        case SERVICE_FINAL_SIGKILL:
+                if (main_pid_good(s) <= 0 && !control_pid_good(s))
+                        service_enter_dead(s, true, true);
+
+                break;
+
         default:
                 ;
         }