1 .\" $OpenBSD: hotplugd.8,v 1.10 2009/03/20 17:53:14 jasper Exp $
3 .\" Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 .Nd devices hot plugging monitor daemon
31 pseudo-device, acting on signaled events by executing the scripts in the
34 By default it uses the
36 device for reading events from, but an alternative device can be
41 Actions can be configured either for device attachment or detachment.
42 On device attachment the
44 script is executed if it exists.
45 On device detachment the
47 script is executed if it exists.
48 In both cases two parameters are passed to the scripts: the class and name
49 of the attached or detached device.
50 The device class corresponds to the classes described in the
52 header file and can be one of the following:
54 .Bl -tag -width Ds -offset indent -compact
56 generic, no special info
58 CPU (carries resource utilization)
69 Not all classes are really usable.
70 For example, it's unlikely that a CPU will be hotplugged.
72 The device name is the usual name, as found in
77 .Bl -tag -width "/dev/hotplug/attach" -compact
81 Directory where the scripts to execute are located.
82 .It /etc/hotplug/attach
83 Script to execute on device attachment.
84 .It /etc/hotplug/detach
85 Script to execute on device detachment.
91 .Bd -literal -offset indent
100 disklabel=`/sbin/disklabel $DEVNAME 2\*(Gt&1 | \e
101 sed -n '/^label: /s/^label: //p'`
105 mount -o nodev,nosuid /dev/"$DEVNAME"i /mnt/camera
110 # network devices; requires hostname.$DEVNAME
111 sh /etc/netstart $DEVNAME
120 program first appeared in
125 program was written by
126 .An Alexander Yurchenko Aq grange@openbsd.org .