From ab9b18b210354385190679eab8dffd00b48d2f0b Mon Sep 17 00:00:00 2001 From: DJ Lucas Date: Tue, 9 Aug 2016 05:53:37 +0000 Subject: Added explanatory text for systemd-230+ process lingering changes. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11104 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/systemd-custom.xml | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'chapter07/systemd-custom.xml') diff --git a/chapter07/systemd-custom.xml b/chapter07/systemd-custom.xml index 26f29beb4..4a5a0187e 100644 --- a/chapter07/systemd-custom.xml +++ b/chapter07/systemd-custom.xml @@ -173,4 +173,60 @@ EOF + + + Long Running Processes + + Beginning with systemd-230, all user processes are killed when a + user session is ended, even if nohup is used, or the process uses + daemon() or setsid(). This is a + deliberate change from a historically permissive environment to a more + restrictive one. The new behavior may cause issues if you depend on long + running programs (e.g., screen or + tmux) to remain active after ending your user + session. There are three ways to enable lingering processes to remain after + a user session is ended. + + + + + Enable process lingering for only needed users: + normal users have permission to enabling process lingering + with the command loginctl enable-linger for their + own user. System administrators can use the same command with a + user argument to enable for a user. That user + can then use the systemd-run command to start + long running processes. For example: systemd-run --scope + --user /usr/bin/screen. If you enable lingering for your + user, the user@.service will remain even after all login sessions are + closed, and will automatically start at system boot. This has the + advantage of explicitly allowing and disallowing processes to run + after the user session has ended, but breaks backwards compatibility + with tools like nohup and utilities that use + deamon(). + + + + + Enable system-wide process lingering: + you can set KillUserProcesses=no in + /etc/logind.conf to enable process lingering + globally for all users. This has the benefit of leaving the old + method available to all users at the expense of explicit control. + + + + + Disable at build-time: You can enable + lingering by default while building systemd by adding the switch + --without-kill-user-processes to the + configure command for systemd. This completely + disables the ability of systemd to kill user processes at session + end. + + + + + + -- cgit v1.2.3-54-g00ecf