Date: Wed, 20 Oct 2004 09:43:42 +0200 From: Jose M Rodriguez <josemi@freebsd.jazztel.es> To: current@freebsd.org Subject: /etc/rc.d/named minor problems. Message-ID: <200410200943.42804.josemi@freebsd.jazztel.es>
next in thread | raw e-mail | index | archive | help
--Boundary-00=_uchdB/bDLKkVszc Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --Boundary-00=_uchdB/bDLKkVszc Content-Type: text/x-diff; charset="us-ascii"; name="patch-named" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-named" --- 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 --Boundary-00=_uchdB/bDLKkVszc--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410200943.42804.josemi>