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" ''
|
"${pkgs.writeShellScript "ssh-inhibit-pam" ''
|
||||||
PIDFILE="/run/ssh-inhibitor-''${PPID}.pid"
|
PIDFILE="/run/ssh-inhibitor-''${PPID}.pid"
|
||||||
case "''${PAM_TYPE:-}" in
|
case "''${PAM_TYPE:-}" in
|
||||||
open)
|
open_session)
|
||||||
${pkgs.systemd}/bin/systemd-inhibit \
|
${pkgs.systemd}/bin/systemd-inhibit \
|
||||||
--what=sleep \
|
--what=sleep \
|
||||||
--who=sshd \
|
--who=sshd \
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
sleep infinity &
|
sleep infinity &
|
||||||
echo $! > "$PIDFILE"
|
echo $! > "$PIDFILE"
|
||||||
;;
|
;;
|
||||||
close)
|
close_session)
|
||||||
if [ -f "$PIDFILE" ]; then
|
if [ -f "$PIDFILE" ]; then
|
||||||
kill "$(cat "$PIDFILE")" 2>/dev/null || true
|
kill "$(cat "$PIDFILE")" 2>/dev/null || true
|
||||||
rm -f "$PIDFILE"
|
rm -f "$PIDFILE"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue