Skip to content

Commit

Permalink
MFC 207346:
Browse files Browse the repository at this point in the history
Fix named-checkconf in the situation where named_chroot_autoupdate
is NOT set, but named_chrootdir IS set.

Remove required_files for named.conf, named-checkconf is enough.
  • Loading branch information
dougb authored and dougb committed May 8, 2010
1 parent 2363963 commit 872e2e3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions etc/rc.d/named
Expand Up @@ -193,6 +193,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
Expand All @@ -202,7 +209,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
Expand Down Expand Up @@ -264,16 +271,15 @@ 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

# 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%/*}"

Expand Down

0 comments on commit 872e2e3

Please sign in to comment.