全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 417|回复: 4

[经验] 如果用debian小鸡装桌面可能需要关掉自动休眠

[复制链接]
发表于 2022-8-1 09:06:52 | 显示全部楼层 |阅读模式
本帖最后由 好鸭 于 2022-8-1 09:45 编辑

有些桌面的电源管理可能会触发"休眠",需要关掉,否则会导致失联


参考的这个https://blog.csdn.net/weixin_45980458/article/details/122952607


1、查看休眠状态

systemctl status sleep.target


2、设置禁止休眠

systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target


3、再查看

systemctl status sleep.target


不会再出现自动休眠状态





用debian装xfce+xrdp还挺舒服的,有点小卡(windows小鸡应该更卡一点点)

用来运行一些gui应用
发表于 2022-8-1 09:08:22 | 显示全部楼层
装了好多了 没遇到这个情况
 楼主| 发表于 2022-8-1 09:12:06 | 显示全部楼层
本帖最后由 好鸭 于 2022-8-1 09:13 编辑
职业菜鸟 发表于 2022-8-1 09:08
装了好多了 没遇到这个情况


我以前也没遇到过,应该是特定版本的问题。具体不知道是啥引起的,但知道是装桌面的过程(装了不止一个桌面)
发表于 2022-8-1 09:24:51 | 显示全部楼层
https://wiki.debian.org/Suspend

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

create /etc/systemd/sleep.conf.d/nosuspend.conf as

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
发表于 2022-8-1 09:30:24 | 显示全部楼层
这样就可以了吧?

  1. root@debian:~# systemctl status sleep.target
  2. ● sleep.target - Sleep
  3.      Loaded: loaded (/lib/systemd/system/sleep.target; static)
  4.      Active: inactive (dead)
  5.        Docs: man:systemd.special(7)

  6. root@debian:~# systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
  7. Created symlink /etc/systemd/system/sleep.target → /dev/null.
  8. Created symlink /etc/systemd/system/suspend.target → /dev/null.
  9. Created symlink /etc/systemd/system/hibernate.target → /dev/null.
  10. Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

  11. root@debian:~# systemctl status sleep.target
  12. ● sleep.target
  13.      Loaded: masked (Reason: Unit sleep.target is masked.)
  14.      Active: inactive (dead)

  15. root@debian:~#
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-6-11 04:29 , Processed in 0.062119 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表