Turn Off laptop heap sleep standby using CentOS 7.0 Power Management
Make full use of computing resources, and install the old HP6325 notebook in the House into CentOS 7.0 for remote control. One problem occurs when CentOS 7.0 power management closes the notebook by default and goes to sleep for standby mode. FTP and SSH cannot be accessed unless manual or Remote Wake-up through the network is performed. This means that the notebook can never close the lid...
Is there a way to cancel the sleep and wait for the notebook to run through power management like a window?
The Linux operating system is of course capable of this.
Power management that can be defined through/etc/systemd
Actions include:
HandlePowerKey: The action after pressing the power key
HandleSleepKey: The action after pressing the hold key
HandleHibernateKey: The action after the sleep key is pressed.
HandleLidSwitch: standby mode after the laptop is closed
The value of these actions can be
Ignore (do nothing)
Poweroff (shutdown)
Reboot (restart)
Halt (what is the difference between shutdown and poweroff? Do you need to manually disconnect the power supply ?)
Suspend (standby pending)
Hibernate)
By default, when I close the notebook screen, the system will wait.
What should I do if I don't want the system to wait when I close my notebook?
Open/etc/systemd/logind. conf In the vi editor.
Remove the annotator # In Front Of HandleLidSwitch and change its value from suspend to ignore.
[Login]
# NAutoVTs = 6
# ReserveVT = 6
# KillUserProcesses = no
# KillOnlyUsers =
# KillExcludeUsers = root
# InhibitDelayMaxSec = 5
# HandlePowerKey = poweroff
# HandleSuspendKey = suspend
# HandleHibernateKey = hibernate
HandleLidSwitch = ignore
# HandleLidSwitchDocked = ignore
# PowerKeyIgnoreInhibited = no
# SuspendKeyIgnoreInhibited = no
# HibernateKeyIgnoreInhibited = no
# LidSwitchIgnoreInhibited = yes
# IdleAction = ignore
# IdleActionSec = 30 min
# RuntimeDirectorySize = 10%
# RemoveIPC = no
~
Then systemctl restart systemd-logind to make the change take effect. Close the notebook lid and you will not be waiting for it.
If you want to enter the STANDBY state, run systemctl suspend.