修改文件:
sudo vim /etc/systemd/logind.conf
将:
#HandleLidSwitch=suspend
修改为:
HandleLidSwitch=ignore
重启服务
然后,重启服务
service systemd-logind restart
或者直接重启
sudo shutdown -r now
即可使设置生效。
说明:
ubuntu desktop 或 ubuntu server 版本测试都有效
sudo vim /etc/systemd/logind.conf
将:
#HandleLidSwitch=suspend
修改为:
HandleLidSwitch=ignore
然后,重启服务
service systemd-logind restart
或者直接重启
sudo shutdown -r now
即可使设置生效。
ubuntu desktop 或 ubuntu server 版本测试都有效