summaryrefslogtreecommitdiff
path: root/src/xdg-autostart-generator
diff options
context:
space:
mode:
authorHenri Chain <henri.chain@enioka.com>2021-11-05 16:11:42 +0100
committerHenri Chain <henri.chain@enioka.com>2021-11-08 10:15:24 +0100
commite83a422797b4f2d0e3b16646937d930e163c56ea (patch)
tree1d0cd90bb09c2a5494a7ba0144e4b564b2a66619 /src/xdg-autostart-generator
parent596e447076b27d103a30c26a68626e9820ac705b (diff)
downloadsystemd-e83a422797b4f2d0e3b16646937d930e163c56ea.tar.gz
Use ExitType=cgroup for autostart generated services
This fixes a bug[1] with some generated autostart app services which fork and exit immediately after main application process start, that caused them not to launch during session startup, as the entire cgroup was immediately killed by systemd. This can also happen with apps such as file browsers, whose initial process will exit after the window is closed, but who intend to leave a daemon child running. Since the forking model of a .desktop application cannot be known at service generation time otherwise, ExitType=cgroup is the only effective way to fix this bug. [1] https://bugs.kde.org/show_bug.cgi?id=433299
Diffstat (limited to 'src/xdg-autostart-generator')
-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 501cdca0b6..241a5b3cfd 100644
--- a/src/xdg-autostart-generator/xdg-autostart-service.c
+++ b/src/xdg-autostart-generator/xdg-autostart-service.c
@@ -597,6 +597,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"