We have a shared office desktop running Ubuntu 18.04 where several jobs (via ssh and screen) often run for weeks on multiple accounts. When logged into an account, sleep/suspend is deactivated through:
- Power settings in main System Setting
- Using
gnome-tweak-tool
, setting "Suspend when laptop lid is closed" to off.
This works fine as long as a user with these power settings is always directly logged into the machine (i.e., physically, not via ssh).
The problem is when no user is currently logged in directly i.e., when the machine is at the main login screen (like on boot up). There does not appear to be a way to set sleep/suspend settings when not logged into a specific account. So, if the machine remains on this screen, it eventually sleeps, suspending all the running jobs.
As I mentioned, things work fine as long as some user is logged in. However, this has been viewed as a security risk. So we'd like to find a better system-wide solution.
I should mention that we have another office desktop running Ubuntu 16.04 which does not have this problem.
/etc/systemd/logind.conf
although not via lidswitch setting). If you do insist on tracking a specific remote login, I think it could be done, but not without root-level service running in background. Disabling suspend globally is an easier solution, and is already available, so I'd recommend that. – Sergiy Kolodyazhnyy Apr 07 '19 at 01:57