|
Lines 13-19
Link Here
|
| 13 |
desc="local caching forwarding resolver" |
13 |
desc="local caching forwarding resolver" |
| 14 |
rcvar="local_unbound_enable" |
14 |
rcvar="local_unbound_enable" |
| 15 |
|
15 |
|
| 16 |
command="/usr/sbin/unbound" |
|
|
| 17 |
extra_commands="anchor configtest reload setup" |
16 |
extra_commands="anchor configtest reload setup" |
| 18 |
start_precmd="local_unbound_prestart" |
17 |
start_precmd="local_unbound_prestart" |
| 19 |
reload_precmd="local_unbound_configtest" |
18 |
reload_precmd="local_unbound_configtest" |
|
Lines 22-39
Link Here
|
| 22 |
setup_cmd="local_unbound_setup" |
21 |
setup_cmd="local_unbound_setup" |
| 23 |
pidfile="/var/run/${name}.pid" |
22 |
pidfile="/var/run/${name}.pid" |
| 24 |
|
23 |
|
| 25 |
: ${local_unbound_workdir:=/var/unbound} |
|
|
| 26 |
: ${local_unbound_config:=${local_unbound_workdir}/unbound.conf} |
| 27 |
: ${local_unbound_flags:=-c${local_unbound_config}} |
| 28 |
: ${local_unbound_forwardconf:=${local_unbound_workdir}/forward.conf} |
| 29 |
: ${local_unbound_anchor:=${local_unbound_workdir}/root.key} |
| 30 |
: ${local_unbound_forwarders:=} |
| 31 |
|
| 32 |
load_rc_config $name |
| 33 |
|
| 34 |
do_as_unbound() |
24 |
do_as_unbound() |
| 35 |
{ |
25 |
{ |
| 36 |
echo "$@" | su -m unbound |
26 |
echo "$@" | /usr/bin/su -m unbound |
| 37 |
} |
27 |
} |
| 38 |
|
28 |
|
| 39 |
# |
29 |
# |
|
Lines 41-47
Link Here
|
| 41 |
# |
31 |
# |
| 42 |
local_unbound_anchor() |
32 |
local_unbound_anchor() |
| 43 |
{ |
33 |
{ |
| 44 |
do_as_unbound /usr/sbin/unbound-anchor -a ${local_unbound_anchor} |
34 |
do_as_unbound ${local_unbound_program%/*}/unbound-anchor \ |
|
|
35 |
-a ${local_unbound_anchor} |
| 45 |
# we can't trust the exit code - check if the file exists |
36 |
# we can't trust the exit code - check if the file exists |
| 46 |
[ -f ${local_unbound_anchor} ] |
37 |
[ -f ${local_unbound_anchor} ] |
| 47 |
} |
38 |
} |
|
Lines 51-57
Link Here
|
| 51 |
# |
42 |
# |
| 52 |
local_unbound_configtest() |
43 |
local_unbound_configtest() |
| 53 |
{ |
44 |
{ |
| 54 |
do_as_unbound /usr/sbin/unbound-checkconf ${local_unbound_config} |
45 |
do_as_unbound ${local_unbound_program%/*}/unbound-checkconf \ |
|
|
46 |
${local_unbound_config} |
| 55 |
} |
47 |
} |
| 56 |
|
48 |
|
| 57 |
# |
49 |
# |
|
Lines 61-67
Link Here
|
| 61 |
local_unbound_setup() |
53 |
local_unbound_setup() |
| 62 |
{ |
54 |
{ |
| 63 |
echo "Performing initial setup." |
55 |
echo "Performing initial setup." |
| 64 |
/usr/sbin/local-unbound-setup -n \ |
56 |
${local_unbound_program%/*}/local-unbound-setup -n \ |
| 65 |
-u unbound \ |
57 |
-u unbound \ |
| 66 |
-w ${local_unbound_workdir} \ |
58 |
-w ${local_unbound_workdir} \ |
| 67 |
-c ${local_unbound_config} \ |
59 |
-c ${local_unbound_config} \ |