Recent versions of Fedora running GNOME desktop unexpectedly suspend.
For systems that also happen to be servers, this is a problem. The
apparent solution is to add a gdm
profile, as outlined on
StackExchange
Disable GDM suspend on lock screen.
Such a gdm
profile works great until gdm
itself crashes
and the system again suspends.
Systemd provides a utility for blocking suspend: systemd-inhibit
.
Similar to nohup
, it's intent is to prevent interruption of
a long-running process.
This package provides a systemd service, inhibit-suspend.service,
that invokes wait-for-signal
, which simply sleeps until it receives
a designated signal (SIGUSR1, by default). By invoking
wait-for-signal
via systemd-inhibit
, this is enough to prevent a
slightly unstable desktop from suspending the system. Hurrah!
Provided your systemd-based OS has GNU make and a C compiler, run:
git clone https://github.com/revolution-robotics/inhibit-suspend.git
make -C inhibit-suspend
sudo make -C inhibit-suspend install
sudo systemctl enable --now inhibit-suspsend