View | Details | Raw Unified | Return to bug 85097 | Differences between
and this patch

Collapse All | Expand All

(-)devd.conf.5 (-1 / +164 lines)
Lines 41-47 Link Here
41
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
41
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
42
.\" SOFTWARE.
42
.\" SOFTWARE.
43
.\"
43
.\"
44
.Dd October 17, 2002
44
.Dd August 18, 2005
45
.Dt DEVD.CONF 5
45
.Dt DEVD.CONF 5
46
.Os
46
.Os
47
.Sh NAME
47
.Sh NAME
Lines 73-78 Link Here
73
specifies various matching criteria and actions to perform when
73
specifies various matching criteria and actions to perform when
74
no device driver currently loaded in the kernel claims a (new)
74
no device driver currently loaded in the kernel claims a (new)
75
device.
75
device.
76
.It Ic notify
77
specifies various matching criteria and actions to perform when the kernel
78
sends an event notification to user land.
76
.El
79
.El
77
.Pp
80
.Pp
78
Statements may occur in any order in the configuration file, and may be
81
Statements may occur in any order in the configuration file, and may be
Lines 80-85 Link Here
80
Further details on the syntax and meaning of each statement and their
83
Further details on the syntax and meaning of each statement and their
81
substatements are explained below.
84
substatements are explained below.
82
.Pp
85
.Pp
86
Each statement, except 
87
.Ql options
88
has a priority (arbitrary number) associated with it, where
89
0 is defined as the lowest priority.
90
If two statements matches the same event, only the action of the statement with
91
highest priority will be carried out. In this way generic statements can be
92
overridden for devices/notifications that requires special attention. 
93
.Pp
94
The general syntax to create a statement is as follows
95
.Pp
96
.Bd -literal
97
statement priority {
98
	substatement "value"; 
99
	...
100
	substatement "value"; 
101
};
102
.Ed
103
.Pp
104
.Ss Substatements
105
The following statements are supported within the 
106
.Ql options
107
statement.
108
.Bl -tag -width ".Ic directory"
109
.It Ic directory \*q/some/path\*q; 
110
Adds the given directory to the list of directories from which devd will read
111
configuration files. Any number of this directive is valid.
112
.It Ic pid-file \*q/var/run/devd.pid\*q;
113
Specifies pid file.
114
.It Ic set regexp-name \*q(some|regexp)\*q;
115
Creates a regular expression and assigns it to the variable
116
regexp-name, this variable is then avaiable through out the rest of 
117
the configuration file.
118
All regular expressions have an implicit ^$ around them.
119
.El
120
.Pp
121
The following statements are supported within the 
122
.Ql attach
123
and
124
.Ql detach
125
statements.
126
.Bl -tag -width ".Ic directory"
127
.It Ic device-name \*qstring\*q;
128
Actually a shorthand to `match device-name'. Matches a device named string.
129
string is allowed to be a regular expression or a variable previously created
130
containing a regular expression.
131
The variable $device-name is avaiable for later use with the action-statement.
132
.It Ic match \*qvariable\*q \*qvalue\*q;
133
Matches the content of value against variable. value can be a regular expression.
134
Not really needed during attach/detach events since the device-name statement
135
takes care of all device matching.
136
For a partial list of variables, see below.
137
.It Ic action \*qcommand\*q;
138
Command to execute upon a successful match. 
139
Example /etc/pccard_ether $device-name start
140
.El
141
.Pp
142
The following statements are supported within the 
143
.Ql nomatch
144
statement. 
145
.Bl -tag -width ".Ic directory"
146
.It Ic match \*qvariable\*q \*qvalue\*q;
147
Matches the content of value against variable. value can be a regular expression.
148
For a partial list of variables, see below.
149
.It Ic action \*qcommand\*q;
150
Same as above.
151
.El
152
.Pp
153
The following statements are supported within the 
154
.Ql notify 
155
statement.
156
The variable
157
.Ql $notify
158
is avaiable inside this statement and contains, possibly, a value depending
159
on which system and subsystem that delivered the event. 
160
.Bl -tag -width ".Ic directory"
161
.It Ic match \*qsystem|subsystem|type\*q \*qvalue\*q;
162
Any number of match-statements can exists within a notify-statement.
163
value can be either a fixed string or a regular expression. 
164
Below is a list of avaiable systems, subsystems and types.
165
.It Ic action \*qcommand\*q;
166
Command to execute upon a successful match. For example 
167
/etc/rc.d/power_profile $notify
168
.El
169
.Ss Variables that can be used with the match-statement
170
Partial list of variables and their possible values that can be used together
171
with the
172
.Ql match
173
statement.
174
.Pp
175
.Bl -tag -width "manufacturer" -compact
176
.It Ic Variable
177
.Ic Possible value
178
.It bus
179
pccard[0-9]+, cardbus[0-9]+
180
.It vendor
181
Vendor ID
182
.It device
183
Device ID
184
.It subvendor
185
Sub-vendor ID
186
.It subdevice
187
Sub-device ID
188
.It class
189
Device class
190
.It slot
191
Card slot
192
.It function
193
Card functions
194
.It manufacturer
195
Manufacturer ID (pccard)
196
.It product 
197
Product ID (pccard)
198
.It cisvendor
199
CIS-vendor
200
.It cisproduct
201
CIS-product
202
.El 
203
.Ss Notify matching 
204
Partial list of systems, subsystems and types used within the
205
.Ql notify
206
mechanism. 
207
.Pp
208
.Bl -tag -width "IFNET" -compact
209
.It Ic System 
210
.It ACPI
211
Events related to the ACPI subsystem.
212
.Bl -tag -compact 
213
.It Ic Subsystem 
214
.It ACAD
215
AC Line state ($notify=0 is offline, 1 is online)
216
.It Button
217
Button state ($notify=0 is power, 1 is sleep)
218
.It CMBAT
219
Battery events.
220
.It Lid
221
Lid state ($notify=0 is closed, 1 is open)
222
.It Thermal
223
Thermal zone events.
224
.El
225
.It IFNET
226
Events related to the network subsystem. 
227
.Bl -tag -compact 
228
.It Ic Subsystem 
229
.It [interface]
230
Subsystem is the actual name of the network interface on which the event 
231
took place.
232
.Bl -tag -compact
233
.It Ic Type
234
.It LINK_UP
235
Carrier status changed to UP.
236
.It LINK_DOWN
237
Carrier status changed to DOWN.
238
.El 
239
.El
240
.El
241
.Ss Comments 
83
Comments may appear anywhere that whitespace may appear in a
242
Comments may appear anywhere that whitespace may appear in a
84
configuration file.
243
configuration file.
85
To appeal to programmers of all kinds, they can
244
To appeal to programmers of all kinds, they can
Lines 118-123 Link Here
118
// is a new comment, even though it is logically
277
// is a new comment, even though it is logically
119
// part of the previous comment.
278
// part of the previous comment.
120
.Ed
279
.Ed
280
.Sh EXAMPLES 
281
The file
282
.Pa /etc/devd.conf
283
contains numerous of different examples.
121
.Sh FILES
284
.Sh FILES
122
.Bl -tag -width ".Pa /etc/devd.conf" -compact
285
.Bl -tag -width ".Pa /etc/devd.conf" -compact
123
.It Pa /etc/devd.conf
286
.It Pa /etc/devd.conf

Return to bug 85097