--- title: "Ubuntu禁用合盖休眠" type: source tags: [ubuntu, 休眠, 笔记本服务器] date: 2025-10-01 --- ## Source File - [[raw/Home Office/Ubuntu禁用合盖休眠.md]] ## Summary - 核心主题:配置 Ubuntu 24.04 笔记本合盖后继续运行而不进入休眠 - 问题域:服务器化改造 - 方法/机制:修改 systemd-logind 配置,设置 HandleLidSwitch 系列参数为 ignore - 结论/价值:笔记本可作为长期运行的服务器,合盖不中断服务 ## Key Claims - 控制文件为 /etc/systemd/logind.conf - 三个关键参数:HandleLidSwitch(电池)、HandleLidSwitchExternalPower(外接电源)、HandleLidSwitchDocked(扩展坞) - 设置为 ignore 后合盖不执行任何操作 - 可选:systemctl mask sleep/suspend/hibernate/hybrid-sleep.target 从内核级别彻底禁用休眠 ## Key Quotes > "HandleLidSwitch=ignore" — 合盖不执行任何操作的关键配置 ## Key Concepts - [[systemd-logind]]:管理系统电源和用户会话的服务 - [[休眠]]:系统挂起到磁盘 ## Key Entities - [[Ubuntu]]:操作系统 ## Connections - [[systemd-logind]] ← controls ← [[休眠]] - [[Ubuntu]] ← runs ← [[systemd-logind]] ## Contradictions - 无