Solve the problem that the black screen cannot be awakened after the laptop CentOS7 is merged
Enable and modify/etc/system/logind. conf
HandleLidSwitch = lock
Save and run the systemctl restart systemd-logind command to take effect immediately.
Refer:
Power Management (Simplified Chinese)
Systemd can handle some power supply-related ACPI events./etc/systemd/logind.conf
Configuration of the following options:
HandlePowerKey
: Action after pressing the power key
HandleSleepKey
: Action after pressing the hold key
HandleHibernateKey
: The action after the sleep key is pressed.
HandleLidSwitch
: Standby mode after the laptop is closed
The action can beignore
,poweroff
,reboot
,halt
,suspend
,hibernate
,hybrid-sleep
,lock
Orkexec
.
The default settings are as follows:
HandlePowerKey=poweroffHandleSuspendKey=suspendHandleHibernateKey=hibernateHandleLidSwitch=suspend
Without graphical interfaces or simple desktop managers such as i3 and awesome, systemd can replace acpid to process ACPI events.
Note: Run
systemctl restart systemd-logind
To make the above changes take effect immediately. Note: systemd cannot handle AC power and battery ACPI events, so you must use Laptop Mode Tools or acpid Tools.
In the current version of systemdHandle
The options will be applied to the entire system unless they are blocked by other programs, such as the power manager in a desktop environment ). If other programs do not stop theseHandle
, You may first be suspended by systemd, and then when the system is awakened, the Power Manager will again suspend the system.
Warning currently, only GNOME and KDE support the "inhibited" command. If you want to use Xfce, acpid, or other programs to manage ACPI events
Handle
Option
ignore
. Note: In addition to the default back-end (used to process standby/sleep) supported by the kernel, systemd can also use other backend (such as Uswsusp or TuxOnIce ).
Ordersystemctl hibernate
To work, follow the settings of sleep and mkinitcpio wake-up extension. (No installation requiredpm-utils
)