local_unbound (283301) | local_unbound (289592) |
---|---|
1#!/bin/sh 2# | 1#!/bin/sh 2# |
3# $FreeBSD: head/etc/rc.d/local_unbound 283301 2015-05-22 21:33:13Z peter $ | 3# $FreeBSD: head/etc/rc.d/local_unbound 289592 2015-10-19 15:56:59Z des $ |
4# 5 6# PROVIDE: local_unbound 7# REQUIRE: FILESYSTEMS netif resolv 8# BEFORE: NETWORKING 9# KEYWORD: shutdown 10 11. /etc/rc.subr 12 13name="local_unbound" 14desc="local caching forwarding resolver" 15rcvar="local_unbound_enable" 16 17command="/usr/sbin/unbound" 18extra_commands="anchor configtest reload setup" 19start_precmd="local_unbound_prestart" | 4# 5 6# PROVIDE: local_unbound 7# REQUIRE: FILESYSTEMS netif resolv 8# BEFORE: NETWORKING 9# KEYWORD: shutdown 10 11. /etc/rc.subr 12 13name="local_unbound" 14desc="local caching forwarding resolver" 15rcvar="local_unbound_enable" 16 17command="/usr/sbin/unbound" 18extra_commands="anchor configtest reload setup" 19start_precmd="local_unbound_prestart" |
20start_postcmd="local_unbound_poststart" |
|
20reload_precmd="local_unbound_configtest" 21anchor_cmd="local_unbound_anchor" 22configtest_cmd="local_unbound_configtest" 23setup_cmd="local_unbound_setup" 24pidfile="/var/run/${name}.pid" 25 26: ${local_unbound_workdir:=/var/unbound} 27: ${local_unbound_config:=${local_unbound_workdir}/unbound.conf} --- 57 unchanged lines hidden (view full) --- 85 fi 86 87 # Retrieve DNSSEC root key 88 if [ ! -f ${local_unbound_anchor} ] ; then 89 run_rc_command anchor 90 fi 91} 92 | 21reload_precmd="local_unbound_configtest" 22anchor_cmd="local_unbound_anchor" 23configtest_cmd="local_unbound_configtest" 24setup_cmd="local_unbound_setup" 25pidfile="/var/run/${name}.pid" 26 27: ${local_unbound_workdir:=/var/unbound} 28: ${local_unbound_config:=${local_unbound_workdir}/unbound.conf} --- 57 unchanged lines hidden (view full) --- 86 fi 87 88 # Retrieve DNSSEC root key 89 if [ ! -f ${local_unbound_anchor} ] ; then 90 run_rc_command anchor 91 fi 92} 93 |
94# 95# After starting, wait for Unbound to report that it is ready to avoid 96# race conditions with services which require functioning DNS. 97# 98local_unbound_poststart() 99{ 100 local retry=5 101 102 echo -n "Waiting for nameserver to start..." 103 until "${command}-control" status | grep -q "is running" ; do 104 if [ $((retry -= 1)) -eq 0 ] ; then 105 echo " giving up" 106 return 1 107 fi 108 echo -n "." 109 sleep 1 110 done 111 echo " good" 112} 113 |
|
93load_rc_config $name 94run_rc_command "$1" | 114load_rc_config $name 115run_rc_command "$1" |