From 6f04a5d9f382971fbf97ac4c2c685ad6b4bbb0b9 Mon Sep 17 00:00:00 2001 From: dougb Date: Fri, 1 Aug 2008 06:11:33 +0000 Subject: When using SRV records the protocols and services files need to be in the chroot /etc directory. PR: conf/121101 Submitted by: Stefan `Sec` Zehl --- etc/rc.d/named | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'etc/rc.d') diff --git a/etc/rc.d/named b/etc/rc.d/named index 7466739..4aedb04 100755 --- a/etc/rc.d/named +++ b/etc/rc.d/named @@ -32,6 +32,8 @@ stop_postcmd="named_poststop" # chroot_autoupdate() { + local file + # Create (or update) the chroot directory structure # if [ -r /etc/mtree/BIND.chroot.dist ]; then @@ -64,12 +66,14 @@ chroot_autoupdate() devfs -m ${named_chrootdir}/dev rule apply path null unhide devfs -m ${named_chrootdir}/dev rule apply path random unhide - # Copy local timezone information if it is not up to date. + # Copy and/or update key files to the chroot /etc # - if [ -r /etc/localtime ]; then - cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || - cp -p /etc/localtime "${named_chrootdir}/etc/localtime" - fi + for file in localtime protocols services; do + if [ -r /etc/$file ]; then + cmp -s /etc/$file "${named_chrootdir}/etc/$file" || + cp -p /etc/$file "${named_chrootdir}/etc/$file" + fi + done } # Make symlinks to the correct pid file -- cgit v1.1