千家信息网

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

发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,本篇文章给大家分享的是有关如何进行RHEL7.2最小化安装后的电源管理配置,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。1 描述公司发了
千家信息网最后更新 2025年12月02日如何进行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安全错误 数据库的锁怎样保障安全 技术开发包含软件开发的 sql语句建立数据库以及表 打开数据库保存位置 简述数据库的DAC和MAC 石家庄格尚网络技术 网络安全工程师是学什么专业的 数据库需求分析师 如何修改数据库数据文件最大值 php连接不上数据库 神武金玉满堂服务器 网络安全工程师做那些工作 关于网络安全主题班会记录 怎么收集数据库汇报材料 面相功能的软件开发方法 sql数据库建立学生登记表 视频管理平台服务器的价格 万方数据库原文下载格式 网络安全靠大家手抄报电子 vb 网页 数据库连接 信息与软件开发现状 数据库的特性 经典笑话下载软件开发 重庆大数据软件开发大概要多少钱 怎样提高网络安全意 杨浦区先进网络技术采购信息 电脑远程桌面服务器没反应 住院管理数据库设计 查询界面 长沙互动博物馆软件开发 常州数据库管理师证 太原华信网络技术有限公司
0