2002-11-09 07:45:53 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: devd
|
2009-09-12 22:13:41 +00:00
|
|
|
# REQUIRE: netif
|
2006-06-01 00:41:07 +00:00
|
|
|
# BEFORE: NETWORKING mountcritremote
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2002-11-09 07:45:53 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="devd"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="devd_enable"
|
2005-10-28 16:55:38 +00:00
|
|
|
command="/sbin/${name}"
|
2010-12-27 22:52:47 +00:00
|
|
|
|
|
|
|
start_precmd=${name}_prestart
|
2011-04-23 04:26:31 +00:00
|
|
|
stop_precmd=find_pidfile
|
|
|
|
|
|
|
|
find_pidfile()
|
|
|
|
{
|
|
|
|
if get_pidfile_from_conf pid-file /etc/devd.conf; then
|
|
|
|
pidfile="$_pidfile_from_conf"
|
|
|
|
else
|
|
|
|
pidfile="/var/run/${name}.pid"
|
|
|
|
fi
|
|
|
|
}
|
2010-12-27 22:52:47 +00:00
|
|
|
|
|
|
|
devd_prestart ()
|
|
|
|
{
|
2011-04-23 04:26:31 +00:00
|
|
|
find_pidfile
|
|
|
|
|
2010-12-27 22:52:47 +00:00
|
|
|
# If devd is disabled, turn it off in the kernel to avoid memory leaks.
|
|
|
|
if ! checkyesno ${rcvar}; then
|
|
|
|
$SYSCTL hw.bus.devctl_disable=1
|
|
|
|
fi
|
|
|
|
}
|
2002-11-09 07:45:53 +00:00
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|