acpid-2.0.34

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-1090

### Chapter 12. System Utilities

- Prev

  AccountsService-26.27.3

- Next

  at-3.2.5

- Up
- Home

# acpid-2.0.34

## Introduction to 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.

### Note

Some other packages may handle some ACPI events as well and they may conflict with this package. For example, elogind-257.16 (read the documentation for `Handle*=` in logind.conf(5) for details) and UPower-1.91.3 (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, elogind-257.16 handles some ACPI events by default, so the handling of these events by elogind-257.16 should be disabled first if handling these events with acpid (again, read logind.conf(5) for details).

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://downloads.sourceforge.net/acpid2/acpid-2.0.34.tar.xz

- Download MD5 sum: 988c2e3fd5ba0ea4492d3ba7273af295

- Download size: 160 KB

- Estimated disk space required: 1.9 MB

- Estimated build time: less than 0.1 SBU

## Installation of acpid

Install acpid by running the following commands:

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

This package does not come with a test suite.

Now, as the `root` user:

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

## Configuring 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 (it requires pm-utils-1.4.1). The example also disables the default handling of the lid close event by elogind-257.16 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/sbin/pm-suspend
    EOF
    chmod +x /etc/acpi/lid.sh

    mkdir -pv /etc/elogind/logind.conf.d
    echo HandleLidSwitch=ignore > /etc/elogind/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.

### Boot Script

To automatically start acpid when the system is rebooted, install the `/etc/rc.d/init.d/acpid` boot script from the blfs-bootscripts-20251220 package.

    make install-acpid

## Contents

Installed Programs: acpid, acpi_listen, and kacpimon
Installed Libraries: None
Installed Directories: /etc/acpi and /usr/share/doc/acpid-2.0.34

### Short Descriptions

acpid | is a program that listens for ACPI events and executes the rules that match the received event
acpi_listen | is a simple tool which connects to acpid and listens for events
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

- Prev

  AccountsService-26.27.3

- Next

  at-3.2.5

- Up
- Home