An active login via SSH into the L5 (via Wifi or USB tethering) should suspend the automatic suspend, IMHO.
You can make it happen if you want. Not sure if documented in the purism wiki but it is documented in the mobian wiki:
https://wiki.mobian.org/doku.php?id=tweaks#prevent-sleep-in-an-ssh-session
If that approach is used, does the inhibit of suspend end automatically when the ssh session ends, or should one be looking to reverse the inhibit (how is that done?) in e.g. .bash_logout
?
Slightly unrelated. mosh (Mobile Shell) is ssh over udp and can deal with temporary disconnects caused by things like suspend or change of network.
The suspend inhibition will end when logging out of the ssh session
A problem is when the Wifi disappears for the L5, because you move away with it from the Wifi zone, the SSH session and the inhibit stay for long time.
You can set keepalive intervals and connection timeouts in sshd config.
I created this file and restarted the sshd:
purism@pureos:~$ cat /etc/ssh/sshd_config.d/add.conf
#
# terminate the session if SSH client does not answer 3 times
# sshd does the check in intervals of 15 secs;
# credits: https://forums.puri.sm/t/login-via-ssh-suspend/20107/7
#
ClientAliveInterval 15
ClientAliveCountMax 3
purism@pureos:~$ sudo systemctl restart sshd
Sometimes SSH sessions and its process survive. I have to investigate, why:
purism@pureos:~$ ps ax | grep inhi
51430 ? Sl 0:00 gnome-session-inhibit --inhibit suspend --reason SSH connection active --inhibit-only
65112 pts/1 Sl 0:00 gnome-session-inhibit --inhibit suspend --reason SSH connection active --inhibit-only
My config looks like this:
- disabled
ssh.service
and enabledssh.socket
- created
ssh-no-sleep@.service
[Unit]
Description=ssh no sleep
BindsTo=ssh@%i.service
[Service]
User=1000
ExecStart=/usr/bin/gnome-session-inhibit --inhibit suspend --inhibit-only --app-id ssh --reason "ssh session "%I
PAMName=systemd-user
[Install]
WantedBy=ssh@.service
- added an override for
ssh@.service
:
[Unit]
Wants=ssh-no-sleep@%i.service
- added these to sshd config:
ClientAliveInterval 60
ClientAliveCountMax 5
So far I’ve been happy with it.