From owner-freebsd-current@FreeBSD.ORG Thu Nov 11 19:14:40 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DB9F16A4CE for ; Thu, 11 Nov 2004 19:14:40 +0000 (GMT) Received: from smtp2.jazztel.es (smtp2.jazztel.es [62.14.3.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 832C343D39 for ; Thu, 11 Nov 2004 19:14:39 +0000 (GMT) (envelope-from josemi@freebsd.jazztel.es) Received: from antivirus by smtp2.jazztel.es with antivirus id 1CSKOy-0007zz-00 for current@freebsd.org Thu, 11 Nov 2004 20:14:36 +0100 Received: from [212.106.238.191] (helo=rguez.homeunix.net) by smtp2.jazztel.es with esmtp id 1CSKOx-0007yP-00 for current@freebsd.org Thu, 11 Nov 2004 20:14:35 +0100 Received: from redesjm.local (orion.redesjm.local [192.168.254.16]) by rguez.homeunix.net (8.13.1/8.13.1) with ESMTP id iABJEY33001503 for ; Thu, 11 Nov 2004 20:14:34 +0100 (CET) (envelope-from josemi@freebsd.jazztel.es) Received: from localhost (localhost [[UNIX: localhost]]) by redesjm.local (8.13.1/8.13.1/Submit) id iABJEYNY028688 for current@freebsd.org; Thu, 11 Nov 2004 20:14:34 +0100 (CET) (envelope-from josemi@freebsd.jazztel.es) X-Authentication-Warning: orion.redesjm.local: freebsd set sender to josemi@freebsd.jazztel.es using -f From: Jose M Rodriguez Date: Thu, 11 Nov 2004 20:14:34 +0100 User-Agent: KMail/1.7.1 To: current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200411112014.34605.josemi@freebsd.jazztel.es> X-AntiVirus: checked by AntiVir Milter (version: 1.1; AVE: 6.28.0.12; VDF: 6.28.0.59; host: antares.redesjm.local) X-Virus-Scanned: by antivirus Subject: /etc/rc.d/named minor problems. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2004 19:14:40 -0000 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