hotplugd man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

HOTPLUGD(8)		  BSD System Manager's Manual		   HOTPLUGD(8)

NAME
     hotplugd — devices hot plugging monitor daemon

SYNOPSIS
     hotplugd

DESCRIPTION
     The hotplugd daemon uses devattr(3) acting on signaled events by execut‐
     ing the scripts in the /etc/hotplug directory.

     Actions can be configured either for device attachment or detachment.  On
     device attachment the attach script is executed if it exists.  On device
     detachment the detach script is executed if it exists.  In both cases two
     parameters are passed to the scripts: the class and name of the attached
     or detached device.  The device class corresponds to the classes
     described in the <sys/device.h> header file and can be one of the follow‐
     ing:

	   0	   generic, no special info
	   1	   CPU (carries resource utilization)
	   2	   disk drive
	   3	   network interface
	   4	   tape device
	   5	   serial line interface

     Not all classes are really usable.	 For example, it's unlikely that a CPU
     will be hotplugged.

     The device name is the usual name, as found in /dev, e.g. da1.

FILES
     /dev/hotplug	  Pseudo-device file.
     /etc/hotplug	  Directory where the scripts to execute are located.
     /etc/hotplug/attach  Script to execute on device attachment.
     /etc/hotplug/detach  Script to execute on device detachment.

EXAMPLES
     Sample attach script:

	   #!/bin/sh

	   DEVCLASS=$1
	   DEVNAME=$2

	   case $DEVCLASS in
	   2)
		   # disk devices
		   disklabel=`/sbin/disklabel $DEVNAME 2>&1 | \
		       sed -n '/^label: /s/^label: //p'`
		   case $disklabel in
		   Sony*DSC*)
			   # Sony DSC camera
			   mount -o nodev,nosuid /dev/"$DEVNAME"i /mnt/camera
			   ;;
		   esac
		   ;;
	   3)
		   # network devices; requires hostname.$DEVNAME
		   sh /etc/netstart $DEVNAME
		   ;;
	   esac

SEE ALSO
     devattr(3)

HISTORY
     The hotplugd program first appeared in OpenBSD 3.6.

     The hotplugd program was adapted to use devattr(3) in DragonFly 2.9.

AUTHORS
     The hotplugd program was written by Alexander Yurchenko
     ⟨grange@openbsd.org⟩.

BSD			       November 14, 2010			   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net