From: Lennart Poettering Date: Sat, 20 Jun 2026 21:35:06 +0000 (+0200) Subject: pam_systemd: add option for acquiring logind inhibitor locks for the duration of... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e652ec10992a2282552b5a1e2950b36b8186c9c2;p=thirdparty%2Fsystemd.git pam_systemd: add option for acquiring logind inhibitor locks for the duration of a session (#42275) This adds support in pam_systemd for acquiring an inhibitor lock when a pam session is active, and can be used (for example) to prevent suspend/sleep of a host when an ssh session is active on the host. The reason string can be customized via `inhibit-why=`. For example, /etc/pam.d/sshd can now contain this line: `-session optional pam_systemd.so inhibit=sleep` And sleep will be blocked when someone is logged into the system over ssh: ``` foo:~$ systemd-inhibit --list --no-pager WHO UID USER PID COMM WHAT WHY MODE NetworkManager 0 root 397 NetworkManager sleep NetworkManager nee… delay Realtime Kit 0 root 401 rtkit-daemon sleep Demote realtime sc… delay sshd 0 root 667 sshd-session.pa sleep Active PAM session block ``` Fixes: #20654 --- e652ec10992a2282552b5a1e2950b36b8186c9c2