禁止Debian 12進入休眠
參考鏈接
查看狀態(tài)
root@leo:~# systemctl status sleep.target
○ sleep.target - Sleep
Loaded: loaded (/lib/systemd/system/sleep.target; static)
Active: inactive (dead)
Docs: man:systemd.special(7)
Aug 24 21:29:24 leo systemd[1]: Reached target sleep.target - Sleep.
Aug 24 21:34:59 leo systemd[1]: Stopped target sleep.target - Sleep.
設(shè)置禁止休眠
root@leo:~# systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
Created symlink /etc/systemd/system/hibernate.target → /dev/null.
Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.
不會再出現(xiàn)自動休眠狀態(tài)
root@leo:~# systemctl status sleep.target
○ sleep.target
Loaded: masked (Reason: Unit sleep.target is masked.)
Active: inactive (dead)