千家信息网

如何进行RHEL7.2最小化安装后的电源管理配置

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,本篇文章给大家分享的是有关如何进行RHEL7.2最小化安装后的电源管理配置,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。1 描述公司发了
千家信息网最后更新 2026年11月01日如何进行RHEL7.2最小化安装后的电源管理配置

本篇文章给大家分享的是有关如何进行RHEL7.2最小化安装后的电源管理配置,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

1 描述

公司发了个测试笔记本。 以最小化安装RHEL7.2后,发现合上笔记本盖后,系统会自动睡眠,网卡会关闭。 在网上找了一通,总算找到了解决办法。

2 操作环境

RHEL7.2 x64

3 详细步骤操作

在/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最小化安装后的电源管理配置,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注行业资讯频道。

电源 配置 笔记 笔记本 最小 管理 动作 文件 合上 待机 命令 更多 知识 篇文章 系统 部分 休眠 实用 公司 办法 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 涨乐互联网科技 科技企业和互联网企业 中国互联网科技发展 互联网金融科技平台 碳银互联网科技有限公司 科技与互联网的利与弊 成都互联网科技公司100强 互联网大会黑科技排名 受益于互联网科技的高速发展 厦门比较好的科技互联网公司 湖北码尼互联网科技有限公司电话 知域互联网科技有限公司大骗子 互联网科技人工智能实验室 本届互联网博览会上的黑科技 晋城互联网科技 江苏互联网智能科技软件 浙南科技城互联网大厦招聘 2021世界互联网领先科技成果发布 六子台科技互联网展会 前海云享互联网科技 互联网科技工作委员会 宜安科技 互联网金融 深圳齐家互联网科技 中盈科技互联网信息有限公司 知域互联网科技有限公司大骗子 搜狐科技互联网 呼和浩特新华互联网科技学院 上海京穆互联网科技有限公司 互联网第三次科技革命特征 湖北辰鑫科技互联网
0