Files
nexus/wiki/sources/ubuntu-disable-lid-close-sleep.md
2026-04-17 08:38:12 +08:00

42 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Ubuntu 禁用合盖休眠"
type: source
tags: [ubuntu, system-admin]
date: 2026-04-17
---
## Source File
- [[raw/Home Office/Ubuntu禁用合盖休眠.md]]
## Summary
- 核心主题:在 Ubuntu 24.04 中禁用笔记本合盖休眠行为
- 问题域Linux 系统管理、服务器运维
- 方法/机制:通过修改 systemd-logind 配置文件,设置 HandleLidSwitch、HandleLidSwitchExternalPower、HandleLidSwitchDocked 为 ignore
- 结论/价值:使笔记本在合盖后继续运行,保持服务可用性
## Key Claims
- systemd-logind 控制 Ubuntu 笔记本合盖休眠行为
- 通过修改 /etc/systemd/logind.conf 可禁用合盖休眠
- 重启 systemd-logind 服务使配置生效
## Key Quotes
> "HandleLidSwitch" — 合盖时的动作(通常指用电池时)
> "HandleLidSwitchExternalPower" — 连接外接电源合盖时的动作
> "HandleLidSwitchDocked" — 连接扩展坞合盖时的动作
> "ignore" — 表示不执行任何操作,即系统继续运行
## Key Concepts
- [[systemd-logind]]systemd 的登录管理器,负责处理电源管理事件
- [[HandleLidSwitch]]:合盖电源行为配置项
- [[休眠 (Hibernate)]]:系统休眠状态,内存数据写入磁盘
- [[待机 (Suspend)]]:系统睡眠状态,保持内存供电
## Key Entities
- [[systemd]]Linux 系统和服务管理器
## Connections
- [[systemd]] ← manages ← [[systemd-logind]]
- [[systemd-logind]] ← controls ← [[HandleLidSwitch]]
## Contradictions
- (无)