美文网首页
禁止系统进入休眠状态

禁止系统进入休眠状态

作者: Leo_23 | 来源:发表于2023-08-23 21:40 被阅读0次

    禁止Debian 12进入休眠
    参考链接

    查看状态

    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.
    

    设置禁止休眠

    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.
    

    不会再出现自动休眠状态

    root@leo:~# systemctl status sleep.target
    ○ sleep.target
         Loaded: masked (Reason: Unit sleep.target is masked.)
         Active: inactive (dead)
    

    相关文章

      网友评论

          本文标题:禁止系统进入休眠状态

          本文链接:https://www.haomeiwen.com/subject/sdxmmdtx.html