查看debian的休眠任务
systemctl status sleep.target
关闭休眠
systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
systemd 支持四种休眠模式:
suspend
休眠到内存。 操作系统停止运行, 如果主机失去电力 将会导致数据丢失, 但是休眠和唤醒速度很快。 这对应于内核的 suspend, standby, freeze 状态。
hibernate
休眠到硬盘。 操作系统停止运行, 即使主机失去电力 也不会导致数据丢失, 但是休眠和唤醒速度很慢。 这对应于内核的 hibernation 状态。
hybrid-sleep
混合休眠(同时休眠到内存和硬盘)。 操作系统停止运行, 如果主机一直没有失去电力, 那么休眠和唤醒速度很快。 如果主机失去电力, 那么休眠和唤醒速度很慢,但是不会导致数据丢失。 这对应于内核的 suspend-to-both 状态。
suspend-then-hibernate
两阶段休眠(先休眠到内存再休眠到硬盘)。 系统首先休眠到内存,如果经过 HibernateDelaySec= 时长之后仍然没有任何操作, 那么系统将会被 RTC 警报唤醒并立即休眠到硬盘。