#!/bin/sh # # $FreeBSD: head/etc/rc.d/devd 238416 2012-07-13 06:46:09Z kevlo $ # # PROVIDE: devd # REQUIRE: netif network_ipv6 # BEFORE: NETWORKING # 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 memory leaks. if ! checkyesno ${rcvar}; then ${SYSCTL_W} hw.bus.devctl_disable=1 fi } load_rc_config $name run_rc_command "$1"