diff options
author | dougb <dougb@FreeBSD.org> | 2010-04-28 22:29:17 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2010-04-28 22:29:17 +0000 |
commit | 9112a6190b5b7cda3b136f493f0fe2e83f186143 (patch) | |
tree | a4c08d78c5f9b72178ab30e7da14dce37f635aab /etc | |
parent | 166a203d5e0b13f7fa327cfc93e8869e75e6399b (diff) | |
download | FreeBSD-src-9112a6190b5b7cda3b136f493f0fe2e83f186143.zip FreeBSD-src-9112a6190b5b7cda3b136f493f0fe2e83f186143.tar.gz |
In the case where named_chroot_autoupdate is NOT set, but
named_chrootdir IS set, named-checkconf fails because it
cannot find the conf file. Fix this by making checkconf a
variable that includes "-t $named_chrootdir" as needed.
Notice of the bug and suggested direction for the fix from [1].
Using required_files for named.conf is overkill ever since
I added the named-checkconf call, so rather than update the
logic to handle the case described above, remove it. This
also handles the case where named_chroot_autoupdate IS set
but the symlink doesn't exist yet.
PR: conf/145904
Submitted by: J R Matthews
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.d/named | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/rc.d/named b/etc/rc.d/named index 346b6fc..81db646 100755 --- a/etc/rc.d/named +++ b/etc/rc.d/named @@ -192,6 +192,13 @@ named_prestart() $confgen_command fi + local checkconf + + checkconf="${command%/named}/named-checkconf" + if ! checkyesno named_chroot_autoupdate && [ -n "$named_chrootdir" ]; then + checkconf="$checkconf -t $named_chrootdir" + fi + # Create a forwarder configuration based on /etc/resolv.conf if checkyesno named_auto_forward; then if [ ! -s /etc/resolv.conf ]; then @@ -201,7 +208,7 @@ named_prestart() [ -s "${named_confdir}/auto_forward.conf" ] && create_file ${named_confdir}/auto_forward.conf - ${command%/named}/named-checkconf $named_conf || + $checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' return fi @@ -263,8 +270,7 @@ named_prestart() create_file ${named_confdir}/auto_forward.conf fi - ${command%/named}/named-checkconf $named_conf || - err 3 'named-checkconf for $named_conf failed' + $checkconf $named_conf || err 3 'named-checkconf for $named_conf failed' } load_rc_config $name @@ -272,7 +278,7 @@ load_rc_config $name # Updating the following variables requires that rc.conf be loaded first # required_dirs="$named_chrootdir" # if it is set, it must exist -required_files="${named_conf:=/etc/namedb/named.conf}" + pidfile="${named_pidfile:-/var/run/named/pid}" named_confdir="${named_chrootdir}${named_conf%/*}" |