Re: Bug in mergemaster(8) when used in service jails (scheme described in chapter 15.6.1 of the handbook)

From: Doug Barton <dougb_at_FreeBSD.org>
Date: Sat, 16 May 2009 14:32:48 -0700
Jeremie Le Hen wrote:
> 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
> % _at__at_ -461,7 +461,7 _at__at_
> %  #
> %  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,

Ok, this has been committed to HEAD, and will be MFCed very soon.


Doug

-- 

    This .signature sanitized for your protection
Received on Sat May 16 2009 - 19:32:53 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:47 UTC