aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdg-autostart-generator/xdg-autostart-service.c
diff options
context:
space:
mode:
authorHenri Chain <henri.chain@enioka.com>2021-02-24 16:13:21 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-31 10:26:07 +0200
commitcb0e818f7cc2499d81ef143e5acaa00c6e684711 (patch)
tree0a1276b1571c2653ecd0c3e1232a910aa14862f7 /src/xdg-autostart-generator/xdg-autostart-service.c
parentMerge pull request #18777 from yuwata/network-set-ifname-to-engines (diff)
downloadsystemd-cb0e818f7cc2499d81ef143e5acaa00c6e684711.tar.xz
systemd-cb0e818f7cc2499d81ef143e5acaa00c6e684711.zip
Introduce ExitType
Notes
description from the pull request: This PR introduces `ExitType=main|cgroup` for services. Similar to how `Type` specifies the launch of a service, `ExitType` is concerned with how systemd determines that a service exited. - If set to `main` (the current behavior), the service manager will consider the unit stopped when the main process exits. - The `cgroup` exit type is meant for applications whose forking model is not known ahead of time and which might not have a specific main process. The service will stay running as long as at least one process in the cgroup is running. The exit status of the service is that of the last process in the cgroup to exit. This is intended for transient or automatically generated services, such as graphical applications inside of a desktop environment. Motivation for this is #16805. `xdg-autostart-generator` was amended to use `ExitType=cgroup`, which fixes https://bugs.kde.org/show_bug.cgi?id=433299, a bug where some generated autostart app services that forked not launching (systemd kills the entire cgroup after the main process exited).
Diffstat (limited to 'src/xdg-autostart-generator/xdg-autostart-service.c')
-rw-r--r--src/xdg-autostart-generator/xdg-autostart-service.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c
index 1528432f433..00d8b765398 100644
--- a/src/xdg-autostart-generator/xdg-autostart-service.c
+++ b/src/xdg-autostart-generator/xdg-autostart-service.c
@@ -599,6 +599,7 @@ int xdg_autostart_service_generate_unit(
fprintf(f,
"\n[Service]\n"
"Type=exec\n"
+ "ExitType=cgroup\n"
"ExecStart=:%s\n"
"Restart=no\n"
"TimeoutSec=5s\n"