home..
Centos7 关闭盖子会断wifi解决办法
wanmyj / February 2023
config
笔记本装CentOS7打算做服务器,结果发现关上盖子后自动断WiFi
- Open the
/etc/systemd/logind.conffile for editing. - Find the
HandleLidSwitch=suspendlinein 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
lockfor the screen to lock;ignorefor nothing to happen;powerofffor 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.