aboutsummaryrefslogtreecommitdiffstats
path: root/chapter07
diff options
context:
space:
mode:
authorDJ Lucas <dj@linuxfromscratch.org>2016-08-09 05:53:37 +0000
committerDJ Lucas <dj@linuxfromscratch.org>2016-08-09 05:53:37 +0000
commitab9b18b210354385190679eab8dffd00b48d2f0b (patch)
treebdd3f95b52db6694a92826647a24d4b9f6bec5ed /chapter07
parentc8389f05c5ee775d320d719310759b65f711e3b6 (diff)
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
Diffstat (limited to 'chapter07')
-rw-r--r--chapter07/systemd-custom.xml56
1 files changed, 56 insertions, 0 deletions
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</userinput></screen>
</itemizedlist>
</sect2>
+
+ <sect2>
+ <title>Long Running Processes</title>
+
+ <para>Beginning with systemd-230, all user processes are killed when a
+ user session is ended, even if nohup is used, or the process uses
+ <function>daemon()</function> or <function>setsid()</function>. 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., <command>screen</command> or
+ <command>tmux</command>) to remain active after ending your user
+ session. There are three ways to enable lingering processes to remain after
+ a user session is ended.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>Enable process lingering for only needed users</emphasis>:
+ normal users have permission to enabling process lingering
+ with the command <command>loginctl enable-linger</command> for their
+ own user. System administrators can use the same command with a
+ <parameter>user</parameter> argument to enable for a user. That user
+ can then use the <command>systemd-run</command> command to start
+ long running processes. For example: <command>systemd-run --scope
+ --user /usr/bin/screen</command>. 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 <command>nohup</command> and utilities that use
+ <function>deamon()</function>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Enable system-wide process lingering</emphasis>:
+ you can set <parameter>KillUserProcesses=no</parameter> in
+ <filename>/etc/logind.conf</filename> 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.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>Disable at build-time</emphasis>: You can enable
+ lingering by default while building systemd by adding the switch
+ <parameter>--without-kill-user-processes</parameter> to the
+ <command>configure</command> command for systemd. This completely
+ disables the ability of systemd to kill user processes at session
+ end.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </sect2>
+
</sect1>