Deleted Added
full compact
devd.8 (111813) devd.8 (113790)
1.\"
2.\" Copyright (c) 2002 M. Warner Losh.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
1.\"
2.\" Copyright (c) 2002 M. Warner Losh.
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\" notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\" notice, this list of conditions and the following disclaimer in the
12.\" documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/sbin/devd/devd.8 111813 2003-03-03 11:51:30Z ru $
26.\" $FreeBSD: head/sbin/devd/devd.8 113790 2003-04-21 06:26:08Z imp $
27.\"
28.Dd October 17, 2002
29.Dt DEVD 8
30.Os
31.Sh NAME
32.Nm devd
33.Nd "device state change daemon"
34.Sh SYNOPSIS
35.Nm
27.\"
28.Dd October 17, 2002
29.Dt DEVD 8
30.Os
31.Sh NAME
32.Nm devd
33.Nd "device state change daemon"
34.Sh SYNOPSIS
35.Nm
36.Op Fl d
36.Op Fl Ddn
37.Sh DESCRIPTION
38The
39.Nm
40daemon provides a way to have userland programs run when certain
41kernel events happen.
42.Pp
43The following options are accepted.
44.Bl -tag -width indent
37.Sh DESCRIPTION
38The
39.Nm
40daemon provides a way to have userland programs run when certain
41kernel events happen.
42.Pp
43The following options are accepted.
44.Bl -tag -width indent
45.It Fl D
46Enable debugging messages.
45.It Fl d
47.It Fl d
46Enable debugging messages and run in the foreground instead of
47becoming a daemon.
48Run in the foreground instead of becoming a daemon.
49.It Fl n
50Don't process all pending events before becoming a daemon.
51Instaed, call daemon right away.
48.El
49.Sh IMPLEMENTATION NOTES
50The
51.Nm
52utility
53is a system daemon that runs in the background all the time.
54Whenever a device is added to or removed from the device tree,
55.Nm
56will execute actions specified in
57.Xr devd.conf 5 .
58For example,
59.Nm
60might execute
61.Xr dhclient 8
62when an Ethernet adapter is added to the system, and kill the
63.Xr dhclient 8
64instance when the same adapter is removed.
65Another example would be for
66.Nm
67to use a table to locate and load via
68.Xr kldload 8
69the proper driver for an unrecognized device that is added to the system.
70.Pp
71The
72.Nm
73utility
74hooks into the
75.Xr devctl 4
76device driver.
77This device driver has hooks into the device configuration system.
78When nodes are added or deleted from the tree, this device will
79deliver information about the event to
80.Nm .
81Once
82.Nm
83has parsed the message, it will search its action list for that kind
84of event and perform the action with the highest matching value.
85For most mundane uses, the default handlers are adequate.
86However, for more advanced users, the power is present to tweak every
87aspect of what happens.
88.Pp
89The
90.Nm
91utility
92reads
93.Pa /etc/devd.conf
94and uses that file to drive the rest of the process.
95While the format of this file is described in
96.Xr devd.conf 5 ,
97some basics are covered here.
98In the
99.Ic options
100section, one can define multiple directories to search
101for config files.
102All files in each of these directories are parsed.
103These files are intended to be installed by third party vendors that
104wish to hook into the
105.Nm
106system without modifying the user's other
107config files.
108.Sh SEE ALSO
109.Xr devctl 4 ,
110.Xr devd.conf 5
111.Sh AUTHORS
112.An M. Warner Losh
52.El
53.Sh IMPLEMENTATION NOTES
54The
55.Nm
56utility
57is a system daemon that runs in the background all the time.
58Whenever a device is added to or removed from the device tree,
59.Nm
60will execute actions specified in
61.Xr devd.conf 5 .
62For example,
63.Nm
64might execute
65.Xr dhclient 8
66when an Ethernet adapter is added to the system, and kill the
67.Xr dhclient 8
68instance when the same adapter is removed.
69Another example would be for
70.Nm
71to use a table to locate and load via
72.Xr kldload 8
73the proper driver for an unrecognized device that is added to the system.
74.Pp
75The
76.Nm
77utility
78hooks into the
79.Xr devctl 4
80device driver.
81This device driver has hooks into the device configuration system.
82When nodes are added or deleted from the tree, this device will
83deliver information about the event to
84.Nm .
85Once
86.Nm
87has parsed the message, it will search its action list for that kind
88of event and perform the action with the highest matching value.
89For most mundane uses, the default handlers are adequate.
90However, for more advanced users, the power is present to tweak every
91aspect of what happens.
92.Pp
93The
94.Nm
95utility
96reads
97.Pa /etc/devd.conf
98and uses that file to drive the rest of the process.
99While the format of this file is described in
100.Xr devd.conf 5 ,
101some basics are covered here.
102In the
103.Ic options
104section, one can define multiple directories to search
105for config files.
106All files in each of these directories are parsed.
107These files are intended to be installed by third party vendors that
108wish to hook into the
109.Nm
110system without modifying the user's other
111config files.
112.Sh SEE ALSO
113.Xr devctl 4 ,
114.Xr devd.conf 5
115.Sh AUTHORS
116.An M. Warner Losh