Skip to content

Commit

Permalink
logind: flip KillUserProcesses to on by default
Browse files Browse the repository at this point in the history
This ensures that users sessions are properly cleaned up after.
The admin can still enable or disable linger for specific users to allow
them to run processes after they log out. Doing that through the user
session is much cleaner and provides better control.

dbus daemon can now be run in the user session (with --enable-user-session,
added in 1.10.2), and most distributions opted to pick this configuration.
In the normal case it makes a lot of sense to kill remaining processes.
The exception is stuff like screen and tmux. But it's easy enough to
work around, a simple example was added to the man page in previous
commit. In the long run those services should integrate with the systemd
users session on their own.

https://bugs.freedesktop.org/show_bug.cgi?id=94508
systemd#2900
  • Loading branch information
keszybz committed Apr 10, 2016
1 parent 0bd9773 commit 899f948
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion man/logind.conf.xml
Expand Up @@ -124,7 +124,7 @@
corresponding to the session and all processes inside that scope will be
terminated. If false, the scope is "abandonded", see
<citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
and processes are not killed. Defaults to <literal>no</literal>.</para>
and processes are not killed. Defaults to <literal>yes</literal>.</para>

<para>In addition to session processes, user process may run under the user
manager unit <filename>user@.service</filename>. Depending on the linger
Expand Down
2 changes: 2 additions & 0 deletions src/login/logind.c
Expand Up @@ -88,6 +88,8 @@ static Manager *manager_new(void) {
if (!m->kill_exclude_users)
goto fail;

m->kill_user_processes = true;

m->udev = udev_new();
if (!m->udev)
goto fail;
Expand Down
2 changes: 1 addition & 1 deletion src/login/logind.conf
Expand Up @@ -14,7 +14,7 @@
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillUserProcesses=yes
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
Expand Down

0 comments on commit 899f948

Please sign in to comment.