From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 16 17:20:22 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A25B616A4D0 for ; Tue, 16 Nov 2004 17:20:22 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A40543D3F for ; Tue, 16 Nov 2004 17:20:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id iAGHKMCP030426 for ; Tue, 16 Nov 2004 17:20:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id iAGHKMoF030425; Tue, 16 Nov 2004 17:20:22 GMT (envelope-from gnats) Resent-Date: Tue, 16 Nov 2004 17:20:22 GMT Resent-Message-Id: <200411161720.iAGHKMoF030425@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jose M Rodriguez Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CECE16A4CE for ; Tue, 16 Nov 2004 17:15:46 +0000 (GMT) Received: from smtp2.jazztel.es (smtp2.jazztel.es [62.14.3.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id A937B43D49 for ; Tue, 16 Nov 2004 17:15:45 +0000 (GMT) (envelope-from josemi@freebsd.jazztel.es) Received: from antivirus by smtp2.jazztel.es with antivirus id 1CU6vd-0003xw-00 for FreeBSD-gnats-submit@freebsd.org Tue, 16 Nov 2004 18:15:41 +0100 Received: from [212.106.252.3] (helo=rguez.homeunix.net) by smtp2.jazztel.es with esmtp id 1CU6vd-0003xH-00 for FreeBSD-gnats-submit@freebsd.org Tue, 16 Nov 2004 18:15:41 +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 iAGHFhl9022982 for ; Tue, 16 Nov 2004 18:15:43 +0100 (CET) (envelope-from freebsd@redesjm.local) Received: (from freebsd@localhost) by redesjm.local (8.13.1/8.13.1/Submit) id iAGHFgCf071028; Tue, 16 Nov 2004 18:15:42 +0100 (CET) (envelope-from freebsd) Message-Id: <200411161715.iAGHFgCf071028@redesjm.local> Date: Tue, 16 Nov 2004 18:15:42 +0100 (CET) From: Jose M Rodriguez To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: conf/74006: [PATCH] /etc/rc.d/named minor fixes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jose M Rodriguez List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2004 17:20:22 -0000 >Number: 74006 >Category: conf >Synopsis: [PATCH] /etc/rc.d/named minor fixes >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Nov 16 17:20:22 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Jose M Rodriguez >Release: FreeBSD 5.3-STABLE i386 >Organization: Redes JM >Environment: System: FreeBSD orion.redesjm.local 5.3-STABLE FreeBSD 5.3-STABLE #0: Tue Nov 16 13:26:33 CET 2004 root@orion.redesjm.local:/usr/obj/usr/src/sys/ORION i386 >Description: Minor fixes to /etc/rc.d/named - add a ${named_chroot_mtree} var To be capable of another chroot mtree without be force to edit /etc/mtree/BIND.chroot.dist - move devfs mount code from chroot_autoupdate() to named_precmd() Mounting fs is not a task that must be expected from chroot_autoupdate(). Do this in named_precmd(), after chroot_autoupdate. - remove /etc/namedb symlink code from chroot_autoupdate() This is the more cosmetic change. Seems that this code is here from initial works in /etc/rc.d/named and: + This is not the place to do that. Maybe in named_precmd(). + Don't seems needed. Sure on that after 5.3 REL >How-To-Repeat: >Fix: --- patch-named begins here --- --- 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 --- patch-named ends here --- >Release-Note: >Audit-Trail: >Unformatted: