ssh: fix prevent sleep on open ssh conn
This commit is contained in:
parent
edc2e50a9b
commit
90dfef044c
1 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@
|
|||
"${pkgs.writeShellScript "ssh-inhibit-pam" ''
|
||||
PIDFILE="/run/ssh-inhibitor-''${PPID}.pid"
|
||||
case "''${PAM_TYPE:-}" in
|
||||
open)
|
||||
open_session)
|
||||
${pkgs.systemd}/bin/systemd-inhibit \
|
||||
--what=sleep \
|
||||
--who=sshd \
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
sleep infinity &
|
||||
echo $! > "$PIDFILE"
|
||||
;;
|
||||
close)
|
||||
close_session)
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
kill "$(cat "$PIDFILE")" 2>/dev/null || true
|
||||
rm -f "$PIDFILE"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue