2002-11-09 08:45:53 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: devd
|
2009-09-13 00:13:41 +02:00
|
|
|
# REQUIRE: netif
|
2006-06-01 02:41:07 +02:00
|
|
|
# BEFORE: NETWORKING mountcritremote
|
2008-07-16 21:50:29 +02:00
|
|
|
# KEYWORD: nojail shutdown
|
2002-11-09 08:45:53 +01:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="devd"
|
2012-01-14 03:18:41 +01:00
|
|
|
rcvar="devd_enable"
|
2005-10-28 18:55:38 +02:00
|
|
|
command="/sbin/${name}"
|
2010-12-27 23:52:47 +01:00
|
|
|
|
|
|
|
start_precmd=${name}_prestart
|
2011-04-23 06:26:31 +02: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 23:52:47 +01:00
|
|
|
|
2012-07-13 08:46:09 +02:00
|
|
|
devd_prestart()
|
2010-12-27 23:52:47 +01:00
|
|
|
{
|
2011-04-23 06:26:31 +02:00
|
|
|
find_pidfile
|
|
|
|
|
2014-03-26 03:25:40 +01:00
|
|
|
# If devd is disabled, turn it off in the kernel to avoid unnecessary
|
|
|
|
# memory usage.
|
2010-12-27 23:52:47 +01:00
|
|
|
if ! checkyesno ${rcvar}; then
|
2014-03-26 03:25:40 +01:00
|
|
|
$SYSCTL hw.bus.devctl_queue=0
|
2010-12-27 23:52:47 +01:00
|
|
|
fi
|
|
|
|
}
|
2002-11-09 08:45:53 +01:00
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|