home..
Centos7 关闭盖子会断wifi解决办法
wanmyj / February 2023
config
笔记本装CentOS7打算做服务器,结果发现关上盖子后自动断WiFi
- Open the
/etc/systemd/logind.conf
file for editing. - Find the
HandleLidSwitch=suspendline
in the file. If it is quoted out with the#
character at the start, unquote it.
If the line is not present in the file, add it. - Replace the default suspendparameter with
lock
for the screen to lock;ignore
for nothing to happen;poweroff
for the computer to switch off. For example:[Login] HandleLidSwitch=lock
- Save your changes and close the editor.
- Run the following command so that your changes preserve the next restart of the system:
# systemctl restart systemd-logind.service
The source code for this article can be found here. If you find any errors or have any comments, please click on the link to raise an issue in the corresponding GitHub repo.