This will stop CENTOS from powering off, suspending, or knocking the network out if you close the lid of the laptop.
Some laptops can overheat if they are left running with the lid closed, especially if they are in a confined place like a backpack. Therefore, consider if changing the default setting (suspend) is the best option in your case.
- Open
/etc/systemd/logind.conf
file for editing. - Find
HandleLidSwitch=suspend
line in the file. If it has a hash/pound (#) symbol, remove it.
Most instructions fail to mention that. Very important.If the line is not present in the file, add it. - Replace the default suspend parameter with one of the following:lock for the screen to lock
poweroff for the computer to switch off
ignore for nothing to happen
Example:
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
It worked for me, thank you very much :D !!!!!!!!!!
ReplyDeleteYou are welcome!
Delete