您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關如何進行RHEL7.2最小化安裝后的電源管理配置,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
公司發了個測試筆記本。 以最小化安裝RHEL7.2后,發現合上筆記本蓋后,系統會自動睡眠,網卡會關閉。 在網上找了一通,總算找到了解決辦法。
在/etc/systemd/logind.conf 此配置文件中定義了基本電源管理項。下面是默認配置
[root@localhost ~]# cat /etc/systemd/logind.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#This is default for OL7.2
RemoveIPC=no
通過man 命令可以看這個文件的說明
[root@localhost ~]# man logind.conf
#...下面是部分說明
HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=, HandleLidSwitchDocked=
Controls whether logind shall handle the system power and sleep keys and the lid switch to trigger actions such as
system power-off or suspend. Can be one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate",
"hybrid-sleep", and "lock". If "ignore", logind will never handle these keys. If "lock", all running sessions will be
screen-locked; otherwise, the specified action will be taken in the respective event. Only input devices with the
"power-switch" udev tag will be watched for key/lid switch events. HandlePowerKey= defaults to "poweroff".
HandleSuspendKey= and HandleLidSwitch= default to "suspend". HandleLidSwitchDocked= defaults to "ignore".
HandleHibernateKey= defaults to "hibernate". If the system is inserted in a docking station, or if more than one
display is connected, the action specified by HandleLidSwitchDocked= occurs; otherwise the HandleLidSwitch= action
occurs.
HandlePowerKey:按下電源鍵后的動作
HandleSleepKey:按下掛起鍵后的動作
HandleHibernateKey: 按下休眠鍵后的動作
HandleLidSwitch:合上筆記本蓋后待機
gnore(什么都不做)
poweroff(關機)
reboot(重新啟動)
halt(關機,和poweroff有什么區別,需要手動斷開電源?)
kexec ( 殺死執行進程 )
suspend(待機掛起)
hibernate(休眠)
如果不想讓系統在合上筆記本的時候待機,編輯/etc/systemd/logind.conf 文件,將HandleLidSwitch注釋去掉,并將值修改為ignore 。然后root用戶執行命令systemctl restart systemd-logind,使更改生效。
以上就是如何進行RHEL7.2最小化安裝后的電源管理配置,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。