Section: Maintenance Commands (8)


acpid - Advanced Configuration and Power Interface event daemon 


acpid [options]



acpid is designed to notify user-space programs of ACPI events.acpid should be started during the system boot, and will run as abackground process, by default. It will open an events file(/proc/acpi/event by default) and attempt to read whole lines whichrepresent ACPI events. If the events file does not exist, acpid willattempt to connect to the Linux kernel via the input layer and netlink. When anACPI event is received from one of these sources, acpid will examine alist of rules, and execute the rules that match the event. acpid willignore all incoming ACPI events if a lock file exists (/var/lock/acpid bydefault).

Rules are defined by simple configuration files. acpidwill look in a configuration directory (/etc/acpi/events by default),and parse all regular files with names that consist entirely of upper andlower case letters, digits, underscores, and hyphens (similar to run-parts(8)).Each file must define two things: an event and anaction. Any blank lines, or lines where the first character is ahash ('#') are ignored. Extraneous lines are flagged as warnings, butare not fatal. Each line has three tokens: the key, a literal equal sign,and the value. The key can be up to 63 characters, and is case-insensitive(but whitespace matters). The value can be up to 511 characters, and iscase and whitespace sensitive.

The event value is a regular expression (see regcomp(3)), against which events are matched.

The action value is a commandline, which will be invoked via /bin/shwhenever an event matching the rule in question occurs. The commandline mayinclude shell-special characters, and they will be preserved. The only specialcharacters in an action value are "%" escaped. The string "%e" will bereplaced by the literal text of the event for which the action was invoked.This string may contain spaces, so the commandline must take care to quote the "%e" if it wants a single token. The string "%%" will be replaced by aliteral "%". All other "%" escapes are reserved, and will cause a rule tonot load.

This feature allows multiple rules to be defined for the same event (though noordering is guaranteed), as well as one rule to be defined for multiple events.To force acpid to reload the rule configuration, send it a SIGHUP.

In addition to rule files, acpid also accepts connections on a UNIXdomain socket (/var/run/acpid.socket by default). Any application mayconnect to this socket. Once connected, acpid will send the text ofall ACPI events to the client. The client has the responsibility of filteringfor messages about which it cares. acpid will not close the clientsocket except in the case of a SIGHUP or acpid exiting.

For faster startup, this socket can be passed in as stdin so that acpidneed not create the socket. In addition, if a socket is passed in as stdin, acpid will not daemonize. It will be run in foreground. This behavior is provided to support systemd(1).

acpidwill log all of its activities, as well as the stdout and stderr of anyactions, to syslog.

All the default files and directories can be changed with commandline options. 


-c, --confdir directory
This option changes the directory in which acpid looks for ruleconfiguration files. Default is /etc/acpi/events.
-C, --clientmax number
This option changes the maximum number of non-root socket connections whichcan be made to the acpid socket. Default is 256.
-d, --debug
This option increases the acpid debug level by one. If the debug levelis non-zero, acpid will run in the foreground, and will log tostderr, in addition to the regular syslog.
-e, --eventfile filename
This option changes the event file from which acpid reads events.Default is /proc/acpi/event.
-n, --netlink
This option forces acpid to use the Linux kernel input layer and netlink interface for ACPI events.
-f, --foreground
This option keeps acpid in the foreground by not forking at startup.
-l, --logevents
This option tells acpid to log information about all events and actions.
-L, --lockfile filename
This option changes the lock file used to stop event processing.Default is /var/lock/acpid.
-g, --socketgroup groupname
This option changes the group ownership of the UNIX domain socket to whichacpid publishes events.
-m, --socketmode mode
This option changes the permissions of the UNIX domain socket to whichacpid publishes events. Default is 0666.
-s, --socketfile filename
This option changes the name of the UNIX domain socket which acpid opens.Default is /var/run/acpid.socket.
-S, --nosocket filename
This option tells acpid not to open a UNIX domain socket. Thisoverrides the -s option, and negates all other socket options.
-p, --pidfile filename
This option tells acpid to use the specified file as its pidfile. Ifthe file exists, it will be removed and over-written.Default is /var/run/
-v, --version
Print version information and exit.
-h, --help
Show help and exit.


This example will shut down your system if you press the power button.

Create a file named /etc/acpi/events/power that contains the following:

action=/etc/acpi/ "%e"

Then create a file named /etc/acpi/ that contains the following:

/sbin/shutdown -h now "Power button pressed"

Now, when acpid is running, a press of the power button will cause therule in /etc/acpi/events/power to trigger the script in /etc/acpi/ script will then shut down the system. 


acpid should work on any linux kernel released since 2003. 




There are no known bugs. To file bug reports, see AUTHORS below. 


regcomp(3), sh(1), socket(2), connect(2), systemd(1), acpi_listen(8),kacpimon(8) 


Ted Felix (
Tim Hockin <>
Andrew Henroid




This document was created byman2html,using the manual pages.