Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Nov 2004 18:15:42 +0100 (CET)
From:      Jose M Rodriguez <josemi@freebsd.jazztel.es>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   conf/74006: [PATCH] /etc/rc.d/named minor fixes
Message-ID:  <200411161715.iAGHFgCf071028@redesjm.local>
Resent-Message-ID: <200411161720.iAGHKMoF030425@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411161715.iAGHFgCf071028>