mergemaster just screwed me

Doug Barton DougB at FreeBSD.org
Thu Oct 7 16:47:50 PDT 2004


On Thu, 7 Oct 2004, Sean McNeil wrote:

>> 1. How do you usually invoke mergemaster?
>> 2. Do you have a .mergemasterrc file?
>> 3. Do you run a MM_PRE_COMPARE_SCRIPT?
>> 4. Do you have any *_BIND_* options in /etc/make.conf?
>> 5. Output of 'ls -la /etc/namedb /var/named/etc/namedb'
>
> 1. I invoke by simply typing mergemaster.
> 2. yes, the contents are:
>
> MM_PRE_COMPARE_SCRIPT=/usr/local/bin/mergemaster_precompare
>
> 3. The contents of /usr/local/bin/mergemaster_precompare are...
>
> #!/bin/sh
>
> # NOTE: No PATH needed, because mm's PATH is already draconian enough
>
> case "${PRE_WORLD}" in
> '')
>        rm -f ${TEMPROOT}/etc/motd
>        rm -f ${TEMPROOT}/etc/hosts ${TEMPROOT}/etc/hosts.allow
>        rm -f ${TEMPROOT}/etc/mail/mailer.conf
>        rm -f ${TEMPROOT}/etc/ssl/openssl.cnf
>        rm -f ${TEMPROOT}/etc/namedb/PROTO.*
> ${TEMPROOT}/etc/namedb/named.* \
>              ${TEMPROOT}/etc/namedb/make-localhost
>        ;;
> esac
>
> ARGH!!!!! That must be it.  Deleting them in TEMPROOT causes them to go
> away in /var/named?
>
> Thanks for the insight.  Now, is what I did here wrong or is this an
> issue with the way things are moved around?

Yeah, that's what I was afraid of. The change that happened in version 
1.334 of src/etc/Makefile symlinked the /etc/namedb in the temproot 
directory to the live directory on the system.

Please try the attached patch and make sure that it works for you, then 
let me know the results.

Doug

-- 

     This .signature sanitized for your protection
-------------- next part --------------
Index: etc/Makefile
===================================================================
RCS file: /usr/local/ncvs/src/etc/Makefile,v
retrieving revision 1.334
diff -u -r1.334 Makefile
--- etc/Makefile	5 Oct 2004 13:03:08 -0000	1.334
+++ etc/Makefile	7 Oct 2004 19:22:42 -0000
@@ -122,10 +122,18 @@
 	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
 	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
 	    ${MTREE} ${DESTDIR}/etc/mtree
-.if !defined(NO_BIND_ETC) && !defined(NO_BIND)
+.if !defined(NO_BIND)
+.if !defined(NO_BIND_ETC)
 	cd ${.CURDIR}/namedb; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
 	    ${NAMEDB} ${DESTDIR}/var/named/etc/namedb
 .endif
+.if !defined(NO_BIND_MTREE)
+	@if [ ! -e ${DESTDIR}/etc/namedb ]; then \
+		set -x; \
+		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
+	fi
+.endif
+.endif
 	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
 	    ${PPPCNF} ${DESTDIR}/etc/ppp
 	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
@@ -184,9 +192,10 @@
 	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \
 	    -p ${DESTDIR}/usr/include
 .endif
+.if !defined(NO_BIND_MTREE)
 	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \
 	    -p ${DESTDIR}/var/named
-	ln -fhs /var/named/etc/namedb ${DESTDIR}/etc/namedb
+.endif
 .endif
 .if !defined(NO_SENDMAIL)
 	mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/
Index: share/examples/etc/make.conf
===================================================================
RCS file: /usr/local/ncvs/src/share/examples/etc/make.conf,v
retrieving revision 1.234
diff -u -r1.234 make.conf
--- share/examples/etc/make.conf	27 Sep 2004 08:23:42 -0000	1.234
+++ share/examples/etc/make.conf	7 Oct 2004 19:24:13 -0000
@@ -145,10 +145,12 @@
 #
 # Variables to control whether parts of the base BIND are built.
 # Defining NO_BIND makes all of the following BIND variables obsolete.
+# Please see the more detailed descriptions in make.conf(5).
 #NO_BIND=		true	# Do not build any part of BIND
 #NO_BIND_DNSSEC=	true	# Do not build dnssec-keygen, dnssec-signzone
 #NO_BIND_ETC=		true	# Do not install files to /etc/namedb
 #NO_BIND_LIBS_LWRES=	true	# Do not install the lwres library
+#NO_BIND_MTREE=		true	# Do not run mtree to create chroot directories
 #NO_BIND_NAMED=		true	# Do not build named, rndc, lwresd, etc.
 #NO_BIND_UTILS=		true	# Do not build dig, host, nslookup, nsupdate
 #WITH_BIND_LIBS=	true	# Install the BIND libs and include files
Index: share/man/man5/make.conf.5
===================================================================
RCS file: /usr/local/ncvs/src/share/man/man5/make.conf.5,v
retrieving revision 1.96
diff -u -r1.96 make.conf.5
--- share/man/man5/make.conf.5	27 Sep 2004 08:23:42 -0000	1.96
+++ share/man/man5/make.conf.5	5 Oct 2004 23:53:33 -0000
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD: src/share/man/man5/make.conf.5,v 1.96 2004/09/27 08:23:42 dougb Exp $
 .\"
-.Dd September 27, 2004
+.Dd October 5, 2004
 .Dt MAKE.CONF 5
 .Os
 .Sh NAME
@@ -612,12 +612,23 @@
 .It Va NO_BIND_ETC
 .Pq Vt bool
 Set to avoid installing the default files to
-.Pa /etc/namedb .
+.Pa /var/named/etc/namedb .
 .It Va NO_BIND_LIBS_LWRES
 .Pq Vt bool
 Set to avoid installing the lightweight resolver library in
 .Pa /usr/lib .
 The library that is private to the build system may still be built as needed.
+.It Va NO_BIND_MTREE
+.Pq Vt bool
+Set to avoid running
+.Xr mtree 8
+to create the chroot directory structure under
+.Pa /var/named ,
+and avoid creating an
+.Pa /etc/namedb
+symlink to the chroot directory.
+This option should typically be used together with
+.Vt NO_BIND_ETC .
 .It Va NO_BIND_NAMED
 .Pq Vt bool
 Set to avoid building or installing


More information about the freebsd-current mailing list