1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $FreeBSD: head/etc/rc.d/devd 216744 2010-12-27 22:52:47Z dougb $
| 3# $FreeBSD: head/etc/rc.d/devd 220962 2011-04-23 04:26:31Z dougb $
|
4# 5 6# PROVIDE: devd 7# REQUIRE: netif 8# BEFORE: NETWORKING mountcritremote 9# KEYWORD: nojail shutdown 10 11. /etc/rc.subr 12 13name="devd" 14rcvar=`set_rcvar` 15command="/sbin/${name}"
| 4# 5 6# PROVIDE: devd 7# REQUIRE: netif 8# BEFORE: NETWORKING mountcritremote 9# KEYWORD: nojail shutdown 10 11. /etc/rc.subr 12 13name="devd" 14rcvar=`set_rcvar` 15command="/sbin/${name}"
|
16pidfile=/var/run/${name}.pid
| |
17 18start_precmd=${name}_prestart
| 16 17start_precmd=${name}_prestart
|
| 18stop_precmd=find_pidfile
|
19
| 19
|
| 20find_pidfile() 21{ 22 if get_pidfile_from_conf pid-file /etc/devd.conf; then 23 pidfile="$_pidfile_from_conf" 24 else 25 pidfile="/var/run/${name}.pid" 26 fi 27} 28
|
20devd_prestart () 21{
| 29devd_prestart () 30{
|
| 31 find_pidfile 32
|
22 # If devd is disabled, turn it off in the kernel to avoid memory leaks. 23 if ! checkyesno ${rcvar}; then 24 $SYSCTL hw.bus.devctl_disable=1 25 fi 26} 27 28load_rc_config $name 29run_rc_command "$1"
| 33 # If devd is disabled, turn it off in the kernel to avoid memory leaks. 34 if ! checkyesno ${rcvar}; then 35 $SYSCTL hw.bus.devctl_disable=1 36 fi 37} 38 39load_rc_config $name 40run_rc_command "$1"
|