diff options
Diffstat (limited to 'etc/rc.d/devd')
-rwxr-xr-x | etc/rc.d/devd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/etc/rc.d/devd b/etc/rc.d/devd new file mode 100755 index 0000000..c7288e4 --- /dev/null +++ b/etc/rc.d/devd @@ -0,0 +1,41 @@ +#!/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" |