]> git.ipfire.org Git - thirdparty/systemd.git/commit
homework: Lock/Unlock: Freeze/Thaw user session
authorAdrian Vovk <adrianvovk@gmail.com>
Sat, 23 Dec 2023 23:00:48 +0000 (18:00 -0500)
committerAdrian Vovk <adrianvovk@gmail.com>
Tue, 5 Mar 2024 17:12:36 +0000 (12:12 -0500)
commita5b009d9355595b30c4da6f4499dd05f6e23ba8c
tree4d4dd670a798c4ad59441cbdd85641c41e359273
parent0b958bb3eeae61dd25a1f6735477ea239981b162
homework: Lock/Unlock: Freeze/Thaw user session

Whenever a home directory is in a locked state, accessing the files of
the home directory is extremely likely to cause the thread to hang. This
will put the session in a strange state, where some threads are hanging
due to file access and others are not hanging because they are not
trying to access any of the user's files.

This can lead to a whole slew of consequences. For example, imagine a
likely situation where the Wayland compositor is not hanging, but the
user's open apps are. Eventually, the compositor will detect that none
of the apps are responding to its pings, assume that they're frozen
(which they are), and kill them. The systemd user instance can end up in
a similarly confused state and start killing user services. In the worst
case, killing an app at an unexpected moment can lead to data loss.

The solution is to suspend execution of the whole user session by
freezing the user's slice.
docs/ENVIRONMENT.md
src/home/homework.c