aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2014-09-08 12:26:52 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2014-09-08 12:26:52 +0000
commit29be5943e8ea5a64d15747c24cb0730b1a9d8105 (patch)
tree13a6e87d55331f7fdc221095c0f747523fae4bd4 /etc
parentfcd7f38fb069aab3edc34ca61899082a018f6bf9 (diff)
downloadsrc-29be5943e8ea5a64d15747c24cb0730b1a9d8105.tar.gz
src-29be5943e8ea5a64d15747c24cb0730b1a9d8105.zip
Revert r271257 after several issues were pointed out. An updated patch
will be committed at a later date.
Notes
Notes: svn path=/head/; revision=271262
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rc.conf7
-rwxr-xr-xetc/rc.d/local_unbound20
2 files changed, 14 insertions, 13 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 766116e22de2..190bb9c074bd 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -267,13 +267,6 @@ hastd_program="/sbin/hastd" # path to hastd, if you want a different one.
hastd_flags="" # Optional flags to hastd.
ctld_enable="NO" # CAM Target Layer / iSCSI target daemon.
local_unbound_enable="NO" # local caching resolver
-local_unbound_program="/usr/sbin/unbound"
-local_unbound_workdir=/var/unbound
-local_unbound_config="${local_unbound_workdir}/unbound.conf"
-local_unbound_flags="-c${local_unbound_config}"
-local_unbound_forwardconf="${local_unbound_workdir}/forward.conf}"
-local_unbound_anchor="${local_unbound_workdir}/root.key"
-local_unbound_forwarders=""
#
# kerberos. Do not run the admin daemons on slave servers
diff --git a/etc/rc.d/local_unbound b/etc/rc.d/local_unbound
index 9a7e19122255..ed69c193d886 100755
--- a/etc/rc.d/local_unbound
+++ b/etc/rc.d/local_unbound
@@ -13,6 +13,7 @@ name="local_unbound"
desc="local caching forwarding resolver"
rcvar="local_unbound_enable"
+command="/usr/sbin/unbound"
extra_commands="anchor configtest reload setup"
start_precmd="local_unbound_prestart"
reload_precmd="local_unbound_configtest"
@@ -21,9 +22,18 @@ configtest_cmd="local_unbound_configtest"
setup_cmd="local_unbound_setup"
pidfile="/var/run/${name}.pid"
+: ${local_unbound_workdir:=/var/unbound}
+: ${local_unbound_config:=${local_unbound_workdir}/unbound.conf}
+: ${local_unbound_flags:=-c${local_unbound_config}}
+: ${local_unbound_forwardconf:=${local_unbound_workdir}/forward.conf}
+: ${local_unbound_anchor:=${local_unbound_workdir}/root.key}
+: ${local_unbound_forwarders:=}
+
+load_rc_config $name
+
do_as_unbound()
{
- echo "$@" | /usr/bin/su -m unbound
+ echo "$@" | su -m unbound
}
#
@@ -31,8 +41,7 @@ do_as_unbound()
#
local_unbound_anchor()
{
- do_as_unbound ${local_unbound_program%/*}/unbound-anchor \
- -a ${local_unbound_anchor}
+ do_as_unbound /usr/sbin/unbound-anchor -a ${local_unbound_anchor}
# we can't trust the exit code - check if the file exists
[ -f ${local_unbound_anchor} ]
}
@@ -42,8 +51,7 @@ local_unbound_anchor()
#
local_unbound_configtest()
{
- do_as_unbound ${local_unbound_program%/*}/unbound-checkconf \
- ${local_unbound_config}
+ do_as_unbound /usr/sbin/unbound-checkconf ${local_unbound_config}
}
#
@@ -53,7 +61,7 @@ local_unbound_configtest()
local_unbound_setup()
{
echo "Performing initial setup."
- ${local_unbound_program%/*}/local-unbound-setup -n \
+ /usr/sbin/local-unbound-setup -n \
-u unbound \
-w ${local_unbound_workdir} \
-c ${local_unbound_config} \