service: properly handle if the main process is down and we wait for the cgroup to die, too

This commit is contained in:
Lennart Poettering 2010-09-03 01:41:40 +02:00
parent 5d452f9cec
commit 7f97f0fee4
1 changed files with 7 additions and 0 deletions

View 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:
;
}