1acpid(8) System Manager's Manual acpid(8)
2
3
4
6 acpid - Advanced Configuration and Power Interface event daemon
7
9 acpid [options]
10
11
13 acpid is designed to notify user-space programs of ACPI events. acpid
14 should be started during the system boot, and will run as a background
15 process, by default. It will open an events file (/proc/acpi/event by
16 default) and attempt to read whole lines which represent ACPI events.
17 If the events file does not exist, acpid will attempt to connect to the
18 Linux kernel via the input layer and netlink. When an ACPI event is
19 received from one of these sources, acpid will examine a list of rules,
20 and execute the rules that match the event. acpid will ignore all
21 incoming ACPI events if a lock file exists (/var/lock/acpid by
22 default).
23
24 Rules are defined by simple configuration files. acpid will look in a
25 configuration directory (/etc/acpi/events by default), and parse all
26 regular files with names that consist entirely of upper and lower case
27 letters, digits, underscores, and hyphens (similar to run-parts(8))
28 that do not begin with a period ('.') or end with a tilde (~). Each
29 file must define two things: an event and an action. Any blank lines,
30 or lines where the first character is a hash ('#') are ignored. Extra‐
31 neous lines are flagged as warnings, but are not fatal. Each line has
32 three tokens: the key, a literal equal sign, and the value. The key
33 can be up to 63 characters, and is case-insensitive (but whitespace
34 matters). The value can be up to 511 characters, and is case and
35 whitespace sensitive.
36
37 The event value is a regular expression (see regcomp(3)), against which
38 events are matched.
39
40 The action value is a commandline, which will be invoked via /bin/sh
41 whenever an event matching the rule in question occurs. The command‐
42 line may include shell-special characters, and they will be preserved.
43 The only special characters in an action value are "%" escaped. The
44 string "%e" will be replaced by the literal text of the event for which
45 the action was invoked. This string may contain spaces, so the comman‐
46 dline must take care to quote the "%e" if it wants a single token. The
47 string "%%" will be replaced by a literal "%". All other "%" escapes
48 are reserved, and will cause a rule to not load.
49
50 This feature allows multiple rules to be defined for the same event
51 (though no ordering is guaranteed), as well as one rule to be defined
52 for multiple events. To force acpid to reload the rule configuration,
53 send it a SIGHUP.
54
55 The pseudo-action <drop> causes the event to be dropped completely and
56 no further processing undertaken; clients connecting via the UNIX
57 domain socket (see below) will not be notified of the event. This may
58 be useful on some machines, such as certain laptops which generate spu‐
59 rious battery events at frequent intervals. The name of this pseudo-
60 action may be redefined with a commandline option.
61
62 In addition to rule files, acpid also accepts connections on a UNIX
63 domain socket (/var/run/acpid.socket by default). Any application may
64 connect to this socket. Once connected, acpid will send the text of
65 all ACPI events to the client. The client has the responsibility of
66 filtering for messages about which it cares. acpid will not close the
67 client socket except in the case of a SIGHUP or acpid exiting.
68
69 For faster startup, this socket can be passed in as stdin so that acpid
70 need not create the socket. In addition, if a socket is passed in as
71 stdin, acpid will not daemonize. It will be run in foreground. This
72 behavior is provided to support systemd(1).
73
74 acpid will log all of its activities, as well as the stdout and stderr
75 of any actions, to syslog.
76
77 All the default files and directories can be changed with commandline
78 options.
79
81 -c, --confdir directory
82 This option changes the directory in which acpid looks for
83 rule configuration files. Default is /etc/acpi/events.
84
85 -C, --clientmax number
86 This option changes the maximum number of non-root socket
87 connections which can be made to the acpid socket. Default
88 is 256.
89
90 -d, --debug This option increases the acpid debug level by one.
91
92 -e, --eventfile filename
93 This option changes the event file from which acpid reads
94 events. Default is /proc/acpi/event.
95
96 -n, --netlink
97 This option forces acpid to use the Linux kernel input
98 layer and netlink interface for ACPI events.
99
100 -f, --foreground
101 This option keeps acpid in the foreground by not forking at
102 startup, and makes it log to stderr instead of syslog.
103
104 -l, --logevents
105 This option tells acpid to log information about all events
106 and actions.
107
108 -L, --lockfile filename
109 This option changes the lock file used to stop event pro‐
110 cessing. Default is /var/lock/acpid.
111
112 -g, --socketgroup groupname
113 This option changes the group ownership of the UNIX domain
114 socket to which acpid publishes events.
115
116 -m, --socketmode mode
117 This option changes the permissions of the UNIX domain
118 socket to which acpid publishes events. Default is 0666.
119
120 -s, --socketfile filename
121 This option changes the name of the UNIX domain socket
122 which acpid opens. Default is /var/run/acpid.socket.
123
124 -S, --nosocket filename
125 This option tells acpid not to open a UNIX domain socket.
126 This overrides the -s option, and negates all other socket
127 options.
128
129 -p, --pidfile filename
130 This option tells acpid to use the specified file as its
131 pidfile. If the file exists, it will be removed and over-
132 written. Default is /var/run/acpid.pid.
133
134 -r, --dropaction action
135 This option defines the pseudo-action which tells acpid to
136 abort all processing of an event, including client notifi‐
137 cations. Default is <drop>.
138
139 -t, --tpmutefix
140 This option enables special handling of the mute button for
141 certain ThinkPad models with mute LEDs that get out of sync
142 with the mute state when the mute button is held down.
143 With this option, the mute button will generate the follow‐
144 ing events in sync with the number of presses (and, by
145 extension, the state of the LED):
146
147 button/mute MUTE (key pressed) K
148 button/mute MUTE (key released) K
149
150 -v, --version
151 Print version information and exit.
152
153 -h, --help Show help and exit.
154
156 This example will shut down your system if you press the power button.
157
158 Create a file named /etc/acpi/events/power that contains the following:
159
160 event=button/power
161 action=/etc/acpi/power.sh "%e"
162
163 Then create a file named /etc/acpi/power.sh that contains the follow‐
164 ing:
165
166 /sbin/shutdown -h now "Power button pressed"
167
168 Now, when acpid is running, a press of the power button will cause the
169 rule in /etc/acpi/events/power to trigger the script in
170 /etc/acpi/power.sh. The script will then shut down the system.
171
173 acpid is a simple program that runs scripts in response to ACPI events
174 from the kernel. When there's trouble, the problem is rarely with
175 acpid itself. The following are some suggestions for finding the most
176 common sources of ACPI-related problems.
177
178 When troubleshooting acpid, it is important to be aware that other
179 parts of a system might be handling ACPI events. systemd(1) is capable
180 of handling the power switch and various other events that are commonly
181 handled by acpid. See the description of HandlePowerKey in
182 logind.conf(5) for more. Some window managers also take over acpid's
183 normal handling of the power button and other events.
184
185 kacpimon(8) can be used to verify that the expected ACPI events are
186 coming in. See the man page for kacpimon(8) for the proper procedure.
187 If the events aren't coming in, you've probably got a kernel driver
188 issue.
189
190 If the expected events are coming in, then you'll need to check and see
191 if your window manager is responsible for handling these events. Some
192 are, some aren't. (E.g. in Ubuntu 14.04 (Unity/GNOME), there are set‐
193 tings for the laptop lid in the System Settings > Power > "When the lid
194 is closed" fields.) If your window manager is responsible for handling
195 the problematic event, and you've got it configured properly, then you
196 may have a window manager issue.
197
198 Lastly, take a look in /etc/acpi/events (see above). Is there a con‐
199 figuration file in there for the event in question (e.g.
200 /etc/acpi/events/lidbtn for laptop lid open/close events)? Is it prop‐
201 erly connected to a script (e.g. /etc/acpi/lid.sh)? Is that script
202 working? It's not unusual for an acpid script to check and see if
203 there is a window manager running, then do nothing if there is. This
204 means it is up to the window manager to handle this event.
205
207 acpid should work on any linux kernel released since 2003.
208
210 /proc/acpi/event
211 /dev/input/event*
212 /etc/acpi/
213 /var/run/acpid.socket
214 /var/run/acpid.pid
215 /var/lock/acpid
216
218 There are no known bugs. To file bug reports, see PROJECT WEBSITE
219 below.
220
222 regcomp(3) sh(1) socket(2) connect(2) init(1) systemd(1) acpi_listen(8)
223 kacpimon(8)
224
226 http://sourceforge.net/projects/acpid2/
227
229 Ted Felix <ted@tedfelix.com>
230 Tim Hockin <thockin@hockin.org>
231 Andrew Henroid
232
233
234
235
236 acpid(8)