之路教程 https://onitr oad .com

配置acpid

acpid 守护进程侦听文件 (/proc/acpi/event),当事件发生时,执行程序来处理事件。
规则由简单的配置文件定义。
acpid 将查看配置目录(默认为 /etc/acpi/events),并解析所有不以句点('.')开头的文件。
每个文件必须定义两件事:一个事件和一个相应的动作。

# ll /etc/acpi/events
total 8
-rw-r--r-- 1 root root 168 Nov 12  2015 power.conf
-rw-r--r-- 1 root root 236 Nov 12  2015 video.conf
# cat /etc/acpi/events/power.conf
# ACPID config to power down machine if powerbutton is pressed, but only if
# no gnome-power-manager is running
event=button/power.*
action=/etc/acpi/actions/power.sh
# cat /etc/acpi/events/video.conf
# Configuration to turn on DPMS again on video activity, needed for some
# laptops. Disabled by default, uncomment if your laptop display stays blank
# after you close and open the lid.
#event=video.*
#action=/usr/sbin/vbetool dpms on

服务控制

要在下次系统启动后控制 acpid 服务,请使用 chkconfig 实用程序:

# chkconfig acpid on
# chkconfig --list acpid
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off

要立即控制 acpid 服务,请使用服务实用程序:

# service  acpid
Usage: /etc/init.d/acpid {start|stop|status|restart|condrestart|reload}

启动acpid服务如下:

# service acpid start
Starting acpi daemon:                                      [  OK  ]

停止acpid服务如下:

# service acpid stop
Stopping acpi daemon:                                      [  OK  ]

检查acpid服务是启动还是停止:

# service acpid status
acpid is stopped

如果acpid服务已启动,则重新启动它,否则什么都不做。

# service acpid condrestart
Stopping acpi daemon:                                      [  OK  ]
Starting acpi daemon:                                      [  OK  ]

确定acpid服务处于活动状态的系统运行级别:

# chkconfig --list acpid
acpid           0:off   1:off   2:off   3:on    4:on    5:on    6:off
Linux 操作系统 acpid 服务

acpid 守护进程支持高级配置和电源接口 (ACPI),以允许对系统进行智能电源管理并查询电池和配置状态。
它侦听文件 (/proc/acpi/event),并在事件发生时执行程序来处理事件。
规则由简单的配置文件定义。
acpid 将查看配置目录(默认为 /etc/acpi/events),并解析所有不以句点('.')开头的文件。
每个文件必须定义两件事:一个事件和一个相应的动作。

该服务由 acpid RPM 包提供。

# yum install acpid
日期:2020-09-17 00:14:34 来源:oir作者:oir