acpid-2.0.34

acpid の概要

The acpid (Advanced Configuration and Power Interface event daemon) is a completely flexible, totally extensible daemon for delivering ACPI events. It listens on netlink interface and when an event occurs, executes programs to handle the event. The programs it executes are configured through a set of configuration files, which can be dropped into place by packages or by the user.

[注記]

注記

Some other packages may handle some ACPI events as well and they may conflict with this package. For example, Systemd-255 (read the documentation for Handle*= in logind.conf(5) for details) and UPower-1.90.2 (used by many desktop environments such as GNOME, KDE, and XFCE for handling ACPI events). If you've installed such a package and it's enough for your use case, this package is probably not needed. If you really need this package, you must be careful configuring it and the other packages handling ACPI events to avoid conflicts. Notably, Systemd-255 handles some ACPI events by default, so the handling of these events by Systemd-255 should be disabled first if handling these events with acpid (again, read logind.conf(5) for details).

[注記]

注記

LFS や依存パッケージが本ブックに示す最新安定バージョンでなかった場合には、BLFS 開発版においては、パッケージのビルドや処理実行が適切に行われないことがあります。

パッケージ情報

acpid のインストール

以下のコマンドを実行して acpid をビルドします。

./configure --prefix=/usr \
            --docdir=/usr/share/doc/acpid-2.0.34 &&
make

このパッケージにテストスイートはありません。

root ユーザーになって以下を実行します。

make install                         &&
install -v -m755 -d /etc/acpi/events &&
cp -r samples /usr/share/doc/acpid-2.0.34

acpid の設定

acpid is configured by user defined events. Place event files under /etc/acpi/events directory. If an event occurs, acpid recurses through the event files in order to see if the regex defined after "event" matches. If they do, action is executed.

The following brief example will suspend the system when the laptop lid is closed. The example also disables the default handling of the lid close event by Systemd-255 when the system is on battery and not connected to any external monitor, in order to avoid a conflict:

cat > /etc/acpi/events/lid << "EOF"
event=button/lid
action=/etc/acpi/lid.sh
EOF

cat > /etc/acpi/lid.sh << "EOF"
#!/bin/sh
/bin/grep -q open /proc/acpi/button/lid/LID/state && exit 0
/usr/bin/systemctl suspend
EOF
chmod +x /etc/acpi/lid.sh

mkdir -pv /etc/systemd/logind.conf.d
echo HandleLidSwitch=ignore > /etc/systemd/logind.conf.d/acpi.conf

Unfortunately, not every computer labels ACPI events in the same way (for example, the lid may be recognized as LID0 instead of LID). To determine how your buttons are recognized, use the acpi_listen tool. Also, look in the samples directory under /usr/share/doc/acpid-2.0.34 for more examples.

Systemd ソケット

To start the acpid daemon at boot, install the systemd unit from the blfs-systemd-units-20231205 package by running the following command as the root user:

make install-acpid
[注記]

注記

This package uses socket based activation and will be started when something needs it. No standalone unit file is provided for this package.

パッケージ構成

インストールプログラム: acpid, acpi_listen, kacpimon
インストールライブラリ: なし
インストールディレクトリ: /etc/acpi, /usr/share/doc/acpid-2.0.34

概略説明

acpid

ACPI イベントを待ち受け、受信したイベントに合致するルールを実行します。

acpi_listen

acpid に接続してイベントを待ち受けるための単純なツールです。

kacpimon

is a monitor program that connects to three sources of ACPI events (events file, netlink and input layer) and then reports on what it sees while it is connected