diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:19:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 02:19:38 +0000 |
commit | 68aafb2658b298c23ed1725b69f5474bee5ee38c (patch) | |
tree | c383770976489dbeeef85ef7bc668da64a242b14 /src/core/service.c | |
parent | Adding upstream version 252.23. (diff) | |
download | systemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.tar.xz systemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.zip |
Adding upstream version 252.25.upstream/252.25
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/core/service.c')
-rw-r--r-- | src/core/service.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/service.c b/src/core/service.c index cdddd49..d382aad 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3378,8 +3378,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: @@ -3648,11 +3650,13 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { default: assert_not_reached(); } - } else if (s->exit_type == SERVICE_EXIT_CGROUP && s->state == SERVICE_START) + } else if (s->exit_type == SERVICE_EXIT_CGROUP && s->state == SERVICE_START && + !IN_SET(s->type, SERVICE_NOTIFY, SERVICE_DBUS)) /* If a main process exits very quickly, this function might be executed * before service_dispatch_exec_io(). Since this function disabled IO events * to monitor the main process above, we need to update the state here too. - * Let's consider the process is successfully launched and exited. */ + * Let's consider the process is successfully launched and exited, but + * only when we're not expecting a readiness notification or dbus name. */ service_enter_start_post(s); } |