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

禁止系统进入休眠状态

作者: 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)

相关文章

  • 禁止系统进入休眠状态

    禁止Debian 12进入休眠参考链接[https://blog.csdn.net/weixin_45980458...

  • Android系统禁止进入休眠

    某些项目中需要系统不进入休眠。修改如下:

  • iOS 禁止系统休眠

    禁止自动休眠可以通过这一句话搞定: 当然一定要慎用,记着退出程序时把自动休眠功能开启 比较适用于上传下载||耗时操...

  • 避免mac进入休眠状态

    不要进入休眠状态: 当你临时不希望电脑进入休眠状态时,可以使用 caffeinate 命令让电脑时刻清醒。当你需要...

  • Deepin休眠

    系统休眠,可以让平时的工作环境保存到硬盘中,以便开机后便可立即进入工作状态. 提醒:分有swap分区的,先验证休眠...

  • 树莓派显示屏的休眠和唤醒

    树莓派直接接HDMI屏幕时,默认情况, 如果没有任何鼠标或键盘动作的话,它的屏幕会自动进入休眠节能的状态 禁止屏幕...

  • 禁止ubuntu休眠

    禁止ubuntu休眠

  • 禁止iphone系统休眠的代码

    把开发过程中重要的代码段做个珍藏,如下代码内容是关于禁止iphone系统休眠的代码。 [UIApplication...

  • 如何让Mac永不休眠,一直点亮

    众所周知,Mac在设计上出于节能的考虑,停止操作一段时间后就会进入休眠状态, Mac休眠先是显示器进入睡眠状态时,...

  • 后台延迟线程挂起

    问题:一般APP在切入后台5s后,线程挂起进入休眠状态。为了使APP进入后台后继续执行任务,则需要延迟后台休眠状态...

网友评论

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

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