]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/rc.d/devd
Merge branch 'releng/11.3' into releng-CDN/11.3
[FreeBSD/FreeBSD.git] / etc / rc.d / devd
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: devd
7 # REQUIRE: netif ldconfig
8 # BEFORE: NETWORKING mountcritremote
9 # KEYWORD: nojail shutdown
10
11 . /etc/rc.subr
12
13 name="devd"
14 desc="Device state change daemon"
15 rcvar="devd_enable"
16 command="/sbin/${name}"
17
18 start_precmd=${name}_prestart
19 stop_precmd=find_pidfile
20
21 find_pidfile()
22 {
23         if get_pidfile_from_conf pid-file /etc/devd.conf; then
24                 pidfile="$_pidfile_from_conf"
25         else
26                 pidfile="/var/run/${name}.pid"
27         fi
28 }
29
30 devd_prestart()
31 {
32         find_pidfile
33
34         # If devd is disabled, turn it off in the kernel to avoid unnecessary
35         # memory usage.
36         if ! checkyesno ${rcvar}; then
37             $SYSCTL hw.bus.devctl_queue=0
38         fi
39 }
40
41 load_rc_config $name
42 run_rc_command "$1"