1106688Simp#!/bin/sh 2106688Simp# 3106688Simp# $FreeBSD$ 4106688Simp# 5106688Simp 6109348Smtm# PROVIDE: devd 7197139Shrs# REQUIRE: netif 8159126Sthompsa# BEFORE: NETWORKING mountcritremote 9180564Sdougb# KEYWORD: nojail shutdown 10106688Simp 11106688Simp. /etc/rc.subr 12106688Simp 13106688Simpname="devd" 14230099Sdougbrcvar="devd_enable" 15151809Syarcommand="/sbin/${name}" 16106688Simp 17216744Sdougbstart_precmd=${name}_prestart 18220962Sdougbstop_precmd=find_pidfile 19216744Sdougb 20220962Sdougbfind_pidfile() 21220962Sdougb{ 22220962Sdougb if get_pidfile_from_conf pid-file /etc/devd.conf; then 23220962Sdougb pidfile="$_pidfile_from_conf" 24220962Sdougb else 25220962Sdougb pidfile="/var/run/${name}.pid" 26220962Sdougb fi 27220962Sdougb} 28220962Sdougb 29238416Skevlodevd_prestart() 30216744Sdougb{ 31220962Sdougb find_pidfile 32220962Sdougb 33263963Smjg # If devd is disabled, turn it off in the kernel to avoid unnecessary 34263963Smjg # memory usage. 35216744Sdougb if ! checkyesno ${rcvar}; then 36263963Smjg $SYSCTL hw.bus.devctl_queue=0 37216744Sdougb fi 38216744Sdougb} 39216744Sdougb 40106688Simpload_rc_config $name 41106688Simprun_rc_command "$1" 42