From owner-freebsd-current@FreeBSD.ORG Sun May 10 11:28:05 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69B42106566C; Sun, 10 May 2009 11:28:05 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtpfb1-g21.free.fr (smtpfb1-g21.free.fr [212.27.42.9]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5E38FC08; Sun, 10 May 2009 11:28:02 +0000 (UTC) (envelope-from jeremie@le-hen.org) Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by smtpfb1-g21.free.fr (Postfix) with ESMTP id F358B77C7BF; Sun, 10 May 2009 13:11:56 +0200 (CEST) Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id D84B04B0105; Sun, 10 May 2009 13:11:49 +0200 (CEST) Received: from endor.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp2-g21.free.fr (Postfix) with ESMTP id 022CA4B00FC; Sun, 10 May 2009 13:11:46 +0200 (CEST) Received: from obiwan.tataz.chchile.org (obiwan.tataz.chchile.org [192.168.1.222]) by endor.tataz.chchile.org (Postfix) with ESMTP id 3253633E60; Sun, 10 May 2009 11:11:10 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id 1F0A45082A; Sun, 10 May 2009 13:11:10 +0200 (CEST) Date: Sun, 10 May 2009 13:11:10 +0200 From: Jeremie Le Hen To: dougb@FreeBSD.org Message-ID: <20090510111110.GA88857@obiwan.tataz.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-current@FreeBSD.org Subject: Bug in mergemaster(8) when used in service jails (scheme described in chapter 15.6.1 of the handbook) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sun, 10 May 2009 11:28:05 -0000 Hi Doug, In the chapter 15.6.1 of the handbook, "Service jails", the last part explains how to upgrade jails. The last step is to run mergmaster(8) in each jail. The problem is that in service jails /etc is a symlink to /s/etc, /s being the readable/writable filesystem. mtree(8) stumbles on /etc being a symlink instead of a directory and doesn't proceed futher down into /etc to check files. Consequently, ${CHANGED} is empty and all customized configuration are overwritten with their default version. I've fixed mergemaster(8) with the following patch: % Index: mergemaster.sh % =================================================================== % RCS file: /mnt/space/cvsroot/src/usr.sbin/mergemaster/mergemaster.sh,v % retrieving revision 1.69 % diff -u -r1.69 mergemaster.sh % --- mergemaster.sh 23 Mar 2009 14:42:41 -0000 1.69 % +++ mergemaster.sh 10 May 2009 11:05:32 -0000 % @@ -461,7 +461,7 @@ % # % CHANGED= % if [ -n "${AUTO_UPGRADE}" -a -f "${DESTDIR}${MTREEFILE}" ]; then % - for file in `mtree -eq -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ % + for file in `mtree -eqL -f ${DESTDIR}${MTREEFILE} -p ${DESTDIR}/ \ % 2>/dev/null | awk '($2 == "changed") {print $1}'`; do % if [ -f "${DESTDIR}/$file" ]; then % CHANGED="${CHANGED} ${DESTDIR}/$file" Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org >