Date: Thu, 11 Nov 2004 20:14:34 +0100 From: Jose M Rodriguez <josemi@freebsd.jazztel.es> To: current@freebsd.org Subject: /etc/rc.d/named minor problems. Message-ID: <200411112014.34605.josemi@freebsd.jazztel.es>
next in thread | raw e-mail | index | archive | help
I founs some minor problems with /etc/rc.d/named in 5.3RC1 and work a
patch on this. I think this must be vaild for HEAD.
- add a ${named_chroot_mtree}, so /etc/mtree/BIND.chroot.dist don't
need rewrite to alter chroot layout.
- supress /etc/named link code. This don't seems really needed here.
Also, detect problems with this. IMHO, this must be carefully take in
installworld/mergemaster.
- move devfs code to named_precmd. This seems to be needed in any
case, not only in chroot autoupdate.
patch attached.
--
josemi
---- patch-bind
--- etc/rc.d/named.orig Wed Oct 20 08:30:58 2004
+++ etc/rc.d/named Wed Oct 20 08:31:19 2004
@@ -30,36 +30,16 @@
{
# Create (or update) the chroot directory structure
#
- if [ -f /etc/mtree/BIND.chroot.dist ]; then
- mtree -deU -f /etc/mtree/BIND.chroot.dist \
+ if [ -f ${named_chroot_mtree:-/etc/mtree/BIND.chroot.dist} ]; then
+ mtree -deU -f ${named_chroot_mtree} \
-p ${named_chrootdir}
else
- warn "/etc/mtree/BIND.chroot.dist missing,"
+ warn "${named_chroot_mtree} missing,"
warn "chroot directory structure not updated"
fi
# Create /etc/namedb symlink
- #
- if [ ! -L /etc/namedb ]; then
- if [ -d /etc/namedb ]; then
- warn "named chroot: /etc/namedb is a directory!"
- elif [ -e /etc/namedb ]; then
- warn "named chroot: /etc/namedb exists!"
- else
- ln -s ${named_chrootdir}/etc/namedb /etc/namedb
- fi
- fi
-
- # Mount a devfs in the chroot directory if needed
- #
- if [ ! -c ${named_chrootdir}/dev/random -o \
- ! -c ${named_chrootdir}/dev/null ]; then
- umount ${named_chrootdir}/dev 2>/dev/null
- mount_devfs devfs ${named_chrootdir}/dev
- fi
- devfs -m ${named_chrootdir}/dev rule apply hide
- devfs -m ${named_chrootdir}/dev rule apply path null unhide
- devfs -m ${named_chrootdir}/dev rule apply path random unhide
+ # this must be a mergemaster task
# Copy local timezone information if it is not up to date.
#
@@ -87,6 +67,16 @@
rc_flags="$rc_flags -t $named_chrootdir"
confgen_chroot="-t${named_chrootdir} -u bind"
checkyesno named_chroot_autoupdate && chroot_autoupdate
+ # Mount a devfs in the chroot directory if needed
+ #
+ if [ ! -c ${named_chrootdir}/dev/random -o \
+ ! -c ${named_chrootdir}/dev/null ]; then
+ umount ${named_chrootdir}/dev 2>/dev/null
+ mount_devfs devfs ${named_chrootdir}/dev
+ fi
+ devfs -m ${named_chrootdir}/dev rule apply hide
+ devfs -m ${named_chrootdir}/dev rule apply path null unhide
+ devfs -m ${named_chrootdir}/dev rule apply path random unhide
else
named_symlink_enable=NO
fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411112014.34605.josemi>
