core/service: don't transition to start-post on cgroup empty event

with ExitType=cgroup

It's not clear to me what the rationale of the logic was
when ExitType=cgroup got introduced. But similar to
the previous commit, I think we should not transition to
'start-post' on cgroup empty event. This is especially
important for Type=dbus/notify services.
This commit is contained in:
Mike Yuan
2024-03-05 10:45:52 +08:00
parent 1651ce09c0
commit f52e9ed62b
+4 -2
View File
@@ -3604,8 +3604,10 @@ static void service_notify_cgroup_empty_event(Unit *u) {
break;
}
if (s->exit_type == SERVICE_EXIT_CGROUP && main_pid_good(s) <= 0)
service_enter_start_post(s);
if (s->exit_type == SERVICE_EXIT_CGROUP && main_pid_good(s) <= 0) {
service_enter_stop_post(s, SERVICE_SUCCESS);
break;
}
_fallthrough_;
case SERVICE_START_POST: