home..

Centos7 关闭盖子会断wifi解决办法

config

笔记本装CentOS7打算做服务器,结果发现关上盖子后自动断WiFi

  1. Open the /etc/systemd/logind.conf file for editing.
  2. 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.
  3. 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
      
  4. Save your changes and close the editor.
  5. 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.

© 2024 wanmyj   •  Powered by Soopr   •  Theme  Moonwalk