xref: /dragonfly/etc/rc.d/udevd (revision b58f1e66)
1#!/bin/sh
2# PROVIDE: udevd
3# REQUIRE: mountcritlocal
4
5. /etc/rc.subr
6
7name="udevd"
8rcvar=`set_rcvar`
9pidfile="/var/run/${name}.pid"
10command="/sbin/${name}"
11start_cmd="udevd_start"
12
13udevd_start()
14{
15	# Avoid doing the hangup+resume maneuver if udevd is
16	# already running normally.
17	if [ ! -e /var/run/udevd.pid ]; then
18		killall -HUP udevd &> /dev/null
19		sleep 1
20	fi
21
22	# If udevd was running before but its stuff was under
23	# the mountpoints, it now should be in place and there
24	# is no need to run it again.
25	if [ ! -e /var/run/udevd.pid ]; then
26		$command
27	fi
28}
29
30load_rc_config $name
31run_rc_command "$1"
32