]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
service: fix main processes exit behavior for type notify services 4259/head
authorJouke Witteveen <j.witteveen@gmail.com>
Sat, 1 Oct 2016 12:06:48 +0000 (14:06 +0200)
committerJouke Witteveen <j.witteveen@gmail.com>
Tue, 22 Nov 2016 16:54:27 +0000 (17:54 +0100)
commit3d474ef7a687e2052aa303e0f95893b2fc610475
tree17f558d966f8cdaaff05e632927c41039e9581d7
parentc35755fb878af58b80ac62a501a75f79c90a3763
service: fix main processes exit behavior for type notify services

Before this commit, when the main process of a Type=notify service exits the
service would enter a running state without passing through the startup post
state. This meant ExecStartPost= from being executed and allowed follow-up
units to start too early (before the ready notification).
Additionally, when RemainAfterExit=yes is used on a Type=notify service, the
exit status of the main process would be disregarded.

After this commit, an unsuccessful exit of the main process of a Type=notify
service puts the unit in a failed state. A successful exit is inconsequential
in case RemainAfterExit=yes. Otherwise, when no ready notification has been
received, the unit is put in a failed state because it has never been active.
When all processes in the cgroup of a Type=notify service are gone and no ready
notification has been received yet, the unit is also put in a failed state.
src/core/service.c