fix systemd unit install path
[external/acpid.git] / acpid.8
1 .TH acpid 8 ""
2 .\" Portions Copyright (c) 2001 Sun Microsystems
3 .\" Portions Copyright (c) Tim Hockin (thockin@hockin.org)
4 .SH NAME
5 acpid \- Advanced Configuration and Power Interface event daemon
6 .SH SYNOPSIS
7 \fBacpid\fP [\fIoptions\fP]
8
9 .SH DESCRIPTION
10 \fBacpid\fP is designed to notify user-space programs of ACPI events.
11 \fBacpid\fP should be started during the system boot, and will run as a
12 background process, by default.  It will open an events file
13 (\fI/proc/acpi/event\fP by default) and attempt to read whole lines which
14 represent ACPI events.  If the events file does not exist, \fBacpid\fP will
15 attempt to connect to the Linux kernel via the input layer and netlink.  When an
16 ACPI event is received from one of these sources, \fBacpid\fP will examine a
17 list of rules, and execute the rules that match the event. \fBacpid\fP will
18 ignore all incoming ACPI events if a lock file exists (\fI/var/lock/acpid\fP by
19 default).
20 .PP
21 \fIRules\fP are defined by simple configuration files.  \fBacpid\fP
22 will look in a configuration directory (\fI/etc/acpi/events\fP by default),
23 and parse all regular files with names that consist entirely of upper and
24 lower case letters, digits, underscores, and hyphens (similar to 
25 run-parts(8)).
26 .\" that do not begin with a period ('.') or end with a tilde (~).  
27 Each file must define two things: an \fIevent\fP and an
28 \fIaction\fP.  Any blank lines, or lines where the first character is a
29 hash ('#') are ignored.  Extraneous lines are flagged as warnings, but
30 are not fatal.  Each line has three tokens: the key, a literal equal sign,
31 and the value.  The key can be up to 63 characters, and is case-insensitive
32 (but whitespace matters).  The value can be up to 511 characters, and is
33 case and whitespace sensitive.
34 .PP
35 The event value is a regular expression (see regcomp(3)), against which events are matched.
36 .PP
37 The action value is a commandline, which will be invoked via \fI/bin/sh\fP
38 whenever an event matching the rule in question occurs.  The commandline may
39 include shell-special characters, and they will be preserved.  The only special
40 characters in an action value are "%" escaped.  The string "%e" will be
41 replaced by the literal text of the event for which the action was invoked.
42 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 a
43 literal "%".  All other "%" escapes are reserved, and will cause a rule to
44 not load.
45 .PP
46 This feature allows multiple rules to be defined for the same event (though no
47 ordering is guaranteed), as well as one rule to be defined for multiple events.
48 To force \fBacpid\fP to reload the rule configuration, send it a SIGHUP.
49 .PP
50 In addition to rule files, \fBacpid\fP also accepts connections on a UNIX
51 domain socket (\fI/var/run/acpid.socket\fP by default).  Any application may
52 connect to this socket.  Once connected, \fBacpid\fP will send the text of
53 all ACPI events to the client.  The client has the responsibility of filtering
54 for messages about which it cares.  \fBacpid\fP will not close the client
55 socket except in the case of a SIGHUP or \fBacpid\fP exiting.
56 .PP
57 For faster startup, this socket can be passed in as stdin so that \fBacpid\fP
58 need not create the socket.  In addition, if a socket is passed in as stdin, 
59 \fBacpid\fP will not daemonize.  It will be run in foreground.  This behavior 
60 is provided to support systemd(1).
61 .PP
62 .B acpid
63 will log all of its activities, as well as the stdout and stderr of any
64 actions, to syslog.
65 .PP
66 All the default files and directories can be changed with commandline options.
67 .SH OPTIONS
68 .TP 12
69 .BI \-c "\fR, \fP" \-\-confdir " directory"
70 This option changes the directory in which \fBacpid\fP looks for rule
71 configuration files.  Default is \fI/etc/acpi/events\fP.
72 .TP 12
73 .BI \-C "\fR, \fP" \-\-clientmax " number"
74 This option changes the maximum number of non-root socket connections which
75 can be made to the \fBacpid\fP socket.  Default is \fI256\fP.
76 .TP 12
77 .BI \-d "\fR, \fP" \-\-debug
78 This option increases the \fBacpid\fP debug level by one.  If the debug level
79 is non-zero, \fBacpid\fP will run in the foreground, and will log to
80 stderr, in addition to the regular syslog.
81 .TP
82 .BI \-e "\fR, \fP" \-\-eventfile " filename"
83 This option changes the event file from which \fBacpid\fP reads events.
84 Default is \fI/proc/acpi/event\fP.
85 .TP
86 .BI \-n "\fR, \fP" \-\-netlink
87 This option forces \fBacpid\fP to use the Linux kernel input layer and netlink interface for ACPI events.
88 .TP
89 .BI \-f "\fR, \fP" \-\-foreground
90 This option keeps \fBacpid\fP in the foreground by not forking at startup.
91 .TP
92 .BI \-l "\fR, \fP" \-\-logevents
93 This option tells \fBacpid\fP to log information about all events and actions.
94 .TP
95 .BI \-L "\fR, \fP" \-\-lockfile " filename"
96 This option changes the lock file used to stop event processing.
97 Default is \fI/var/lock/acpid\fP.
98 .TP
99 .BI \-g "\fR, \fP" \-\-socketgroup " groupname"
100 This option changes the group ownership of the UNIX domain socket to which
101 \fBacpid\fP publishes events.
102 .TP
103 .BI \-m "\fR, \fP" \-\-socketmode " mode"
104 This option changes the permissions of the UNIX domain socket to which
105 \fBacpid\fP publishes events.  Default is \fI0666\fP.
106 .TP
107 .BI \-s "\fR, \fP" \-\-socketfile " filename"
108 This option changes the name of the UNIX domain socket which \fBacpid\fP opens.
109 Default is \fI/var/run/acpid.socket\fP.
110 .TP
111 .BI \-S "\fR, \fP" \-\-nosocket " filename"
112 This option tells \fBacpid\fP not to open a UNIX domain socket.  This
113 overrides the \fI-s\fP option, and negates all other socket options.
114 .TP
115 .BI \-p "\fR, \fP" \-\-pidfile " filename"
116 This option tells \fBacpid\fP to use the specified file as its pidfile.  If
117 the file exists, it will be removed and over-written.
118 Default is \fI/var/run/acpid.pid\fP.
119 .TP
120 .BI \-v "\fR, \fP" \-\-version
121 Print version information and exit.
122 .TP
123 .BI \-h "\fR, \fP" \-\-help
124 Show help and exit.
125 .SH EXAMPLE
126 This example will shut down your system if you press the power button.
127 .PP
128 Create a file named /etc/acpi/events/power that contains the following:
129 .IP
130 .br
131 event=button/power
132 .br
133 action=/etc/acpi/power.sh "%e"
134 .PP
135 Then create a file named /etc/acpi/power.sh that contains the following:
136 .IP
137 /sbin/shutdown \-h now "Power button pressed"
138 .PP
139 Now, when \fBacpid\fP is running, a press of the power button will cause the
140 rule in /etc/acpi/events/power to trigger the script in /etc/acpi/power.sh.
141 The script will then shut down the system.
142 .SH DEPENDENCIES
143 \fBacpid\fP should work on any linux kernel released since 2003.
144 .SH FILES
145 .PD 0
146 .B /proc/acpi/event
147 .br
148 .B /dev/input/event*
149 .br
150 .B /etc/acpi/
151 .br
152 .B /var/run/acpid.socket
153 .br
154 .B /var/run/acpid.pid
155 .br
156 .B /var/lock/acpid
157 .br
158 .PD
159 .SH BUGS
160 There are no known bugs.  To file bug reports, see \fBAUTHORS\fP below.
161 .SH SEE ALSO
162 regcomp(3), sh(1), socket(2), connect(2), systemd(1), acpi_listen(8),
163 kacpimon(8)
164 .SH AUTHORS
165 Ted Felix (www.tedfelix.com)
166 .br
167 Tim Hockin <thockin@hockin.org>
168 .br
169 Andrew Henroid
170