I'm having a server that apparently randomly goes to sleep and I cannot figure out what actually triggers that state in the system logs.
Hence my question: what process(es) or event(s) are able to actually trigger the status of the following systemd
target into an active
state (e.g. putting the system into sleep) on Ubuntu 22.04?
$ systemctl status suspend.target
○ suspend.target - Suspend
Loaded: loaded (/lib/systemd/system/suspend.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
That would be
Mind that
enable
will error out if the system service has faults and it will show this:If so to enable it ... that issue needs to be fixed 1st.
From what I can see is that the power saving triggers it. Upon reading through the
man systemd.special
you can see that thesuspend.target
pulls in thesleep.target
and will be called upon when it is needed.It is part of the
Special System Units
that is managed by the system service manager.Running
systemctl start systemd-suspend.service
will put your system right to sleep as it is now active, so it has to remain inactive until it is needed.