File: acpid.8

package info (click to toggle)
acpid 1.0.4-5etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 232 kB
  • ctags: 136
  • sloc: ansic: 1,336; perl: 283; sh: 133; makefile: 78
file content (133 lines) | stat: -rw-r--r-- 5,551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.TH acpid 8 "August 2001"
.\" Copyright (c) 2001 Sun Microsystems (thockin@sun.com)
.SH NAME
acpid \- Advanced Configuration and Power Interface event daemon
.SH SYNOPSIS
\fBacpid\fP [\fIoptions\fP]

.SH DESCRIPTION
\fBacpid\fP is designed to notify user-space programs of ACPI events.
\fBacpid\fP should be started during the system boot, and will run as a 
background process, by default.  It will open an events file 
(\fI/proc/acpi/event\fP by default) and attempt to read whole lines.  When 
a line is received (an \fIevent\fP), \fBacpid\fP will examine a list of rules, 
and execute the rules that match the event. 
.PP
\fIRules\fP are defined by simple configuration files.  \fBacpid\fP
will look in a configuration directory (\fI/etc/acpi/events\fP by default), 
and parse all files that fit to a runparts style naming convetion. This means
that files containing a dot and contain characters different from a-z and 0-9
would be ignored. Debian implementation differs at this point from standard
acpid. Each file must
define two things: an \fIevent\fP and an \fIaction\fP.  Any blank lines, or
lines where the first character is a pound sign ('#') are ignored.  Extraneous
lines are flagged as warnings, but are 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 is case and whitespace sensitive.
.PP
The event value is a regular expression (see regcomp(3)), against which events are matched.
.PP
The action value is a commandline, which will be invoked via \fI/bin/sh\fP
whenever an event matching the rule in question occurs.  The commandline may
include shell-special characters, and they will be preserved.  The only special
characters in an action value are "%" escaped.  The string "%e" will be
replaced 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 a 
literal "%".  All other "%" escapes are reserved, and will cause a rule to 
not load.
.PP
This feature allows multiple rules to be defined for the same event (though no
ordering is guaranteed), as well as one rule to be defined for multiple events.
To force \fBacpid\fP to reload the rule configuration, send it a SIGHUP.
.PP
In addition to rule files, \fBacpid\fP also accepts connections on a UNIX 
domain socket (\fI/var/run/acpid.socket\fP by default).  Any application may 
connect to this socket.  Once connected, \fBacpid\fP will send the text of 
all ACPI events to the client.  The client has the responsibility of filtering
for messages about which it cares.  \fBacpid\fP will not close the client 
socket except in the case of a SIGHUP or \fBacpid\fP exiting.
.PP
.B acpid
will log all of it's activities, as well as the stdout and stderr of any
actions to a log file (\fI/var/log/acpid\fP by default). 
.PP
All the default file and directories can be changed with commandline options.
.SH OPTIONS
.TP 12
.BI \-c "\fR, \fP" \--confdir " directory"
This option changes the directory in which \fBacpid\fP looks for rule 
configuration files.  Default is \fI/etc/acpi/events\fP.
.TP 12
.BI \-C "\fR, \fP" \--clientmax " number"
This option changes the maximum number of non-root socket connections which
can be made to the \fBacpid\fP socket.  Default is \fI256\fP.
.TP 12
.BI \-d "\fR, \fP" \--debug
This option increases the \fBacpid\fP debug level by one.  If the debug level
is non-zero, \fBacpid\fP will run in the foreground, and will log to
stdout/stderr, rather than a log file.
.TP
.BI \-e "\fR, \fP" \--eventfile " filename"
This option changes the event file from which \fBacpid\fP reads events.
Default is \fI/proc/acpi/event\fP.
.TP
.BI \-g "\fR, \fP" \--socketgroup " groupname"
This option changes the group ownership of the UNIX domain socket to which 
\fBacpid\fP publishes events.
.TP
.BI \-l "\fR, \fP" \--logfile " filename"
This option changes the log file to which \fBacpid\fP writes.  Default is
\fI/var/log/acpid\fP.
.TP
.BI \-m "\fR, \fP" \--socketmode " mode"
This option changes the permissions of the UNIX domain socket to which
\fBacpid\fP publishes events.  Default is \fI0666\fP.
.TP
.BI \-s "\fR, \fP" \--socketfile " filename"
This option changes the name of the UNIX domain socket which \fBacpid\fP opens.
Default is \fI/var/run/acpid.socket\fP.
.TP
.BI \-S "\fR, \fP" \--nosocket " filename"
This option tells \fBacpid\fP not to open a UNIX domain socket.  This 
overrides the \fI-s\fP option, and negates all other socket options.
.TP
.BI \-v "\fR, \fP" \--version
Print version information and exit.
.TP
.BI \-h "\fR, \fP" \--help
Show help and exit.
.SH EXAMPLE
This example - placed in /etc/acpi/events/power - will shut down your system
if you press the power button.
.PP
.br
event=button/power.*
.br
action=/usr/local/sbin/power.sh "%e"
.PP
The script power.sh gets called and will see the complete event string
as parameter $1. 
.SH DEPENDENCIES
Please make sure you are using the latest ACPI code possible. This is
available from 
.BR
    \fIhttp://developer.intel.com/technology/iapc/acpi/downloads.htm\fP.
.SH FILES
.PD 0
.B /proc/acpi/event
.br
.B /etc/acpi/
.br
.B /var/log/acpid
.br
.B /var/run/acpid.socket
.br
.PD
.SH BUGS
There are no known bugs.  To file bug reports, see \fBAUTHORS\fP below.
.SH SEE ALSO
regcomp(3), sh(1), socket(2), connect(2)
.SH AUTHORS
Tim Hockin <thockin@sun.com>