关闭
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
查看
sudo systemctl status sleep.target suspend.target hibernate.target hybrid-sleep.target
————————————————————————————————————————————————–
I found the solution. This method works better and doesn’t have the spurious message on connected SSH clients.
Create /etc/systemd/sleep.conf.d/nosuspend.conf as
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
They should probably edit the documentation and swap both solution so this one is the first one and not marked as an “alternative”