CentOS7 black screen after combination, but do not enter sleep mode modify systemd can handle some power-related ACPI events, you can through/etc/system/logind. configure the following options in conf: HandlePowerKey: HandleSleepKey: Hang: CentOS 7, black screen, but not sleep mode. modify systemd to handle power-related ACPI events, you can use/etc/system/logind. conf:
HandlePowerKey action after pressing the power key
HandleSleepKey: the behavior of pressing the hold key
HandleHibernateKey action after pressing the sleep key
HandleLidSwitch
The behavior can be ignore, poweroff, reboot, halt, suspend, hibernate, hybrid-sleep, lock, or kexec.
The default settings are as follows:
HandlePowerKey = poweroff
HandleSuspendKey = suspend
HandleHibernateKey = hibernate
HandleLidSwitch = suspend
You only need to set the HandleLidSwitch option to the following:
HandleLidSwitch = lock
Note: After the settings are saved, run the systemctl restart systemd-logind command.