Remove building with NOCRYPTO option
[minix.git] / external / bsd / blacklist / etc / rc.d / blacklistd
blob2e46f518fc7087c72164dc08fe31ac58dcb59bc4
1 #!/bin/sh
3 # $NetBSD: blacklistd,v 1.1 2015/01/22 17:49:41 christos Exp $
6 # PROVIDE: blacklistd
7 # REQUIRE: npf
8 # BEFORE: SERVERS
10 $_rc_subr_loaded . /etc/rc.subr
12 name="blacklistd"
13 rcvar=$name
14 command="/sbin/${name}"
15 pidfile="/var/run/${name}.pid"
16 required_files="/etc/${name}.conf"
17 start_precmd="${name}_precmd"
18 extra_commands="reload"
20 _sockfile="/var/run/${name}.sockets"
21 _sockname="blsock"
23 blacklistd_precmd()
25 # Create default list of blacklistd sockets to watch
27 ( umask 022 ; > $_sockfile )
29 # Find /etc/rc.d scripts with "chrootdir" rcorder(8) keyword,
30 # and if $${app}_chrootdir is a directory, add appropriate
31 # blacklistd socket to list of sockets to watch.
33 for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do
35 _l=${_lr##*/}
36 load_rc_config ${_l}
37 eval _ldir=\$${_l}_chrootdir
38 if checkyesno $_l && [ -n "$_ldir" ]; then
39 echo "${_ldir}/var/run/${_sockname}" >> $_sockfile
42 done
44 # If other sockets have been provided, change run_rc_command()'s
45 # internal copy of $blacklistd_flags to force use of specific
46 # blacklistd sockets.
48 if [ -s $_sockfile ]; then
49 echo "/var/run/${_sockname}" >> $_sockfile
50 rc_flags="-P $_sockfile $rc_flags"
53 return 0
56 load_rc_config $name
57 run_rc_command "$1"