freebsd-dev/etc/rc.d/devd
Mateusz Guzik ee38f2e004 Update userspace users of hw.bus.devctl_disable.
This fixes breakage resulting from r263754.

Reported by:	AN <andy@neu.net>
Reviewed by:	imp
Pointy hat to:	me
2014-03-26 02:25:40 +00:00

42 lines
641 B
Bash
Executable File

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: devd
# REQUIRE: netif
# BEFORE: NETWORKING mountcritremote
# KEYWORD: nojail shutdown
. /etc/rc.subr
name="devd"
rcvar="devd_enable"
command="/sbin/${name}"
start_precmd=${name}_prestart
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
}
devd_prestart()
{
find_pidfile
# If devd is disabled, turn it off in the kernel to avoid unnecessary
# memory usage.
if ! checkyesno ${rcvar}; then
$SYSCTL hw.bus.devctl_queue=0
fi
}
load_rc_config $name
run_rc_command "$1"