From owner-freebsd-stable@FreeBSD.ORG Wed Mar 11 09:19:46 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7D674F7 for ; Wed, 11 Mar 2015 09:19:46 +0000 (UTC) Received: from mailgate.leissner.se (mailgate.leissner.se [212.3.1.210]) by mx1.freebsd.org (Postfix) with ESMTP id 5219CB65 for ; Wed, 11 Mar 2015 09:19:45 +0000 (UTC) Received: from mailgate.leissner.se (localhost [127.0.0.1]) by mailgate.leissner.se (8.14.9/8.14.9) with ESMTP id t2B9JgtY053657 for ; Wed, 11 Mar 2015 10:19:42 +0100 (CET) (envelope-from list-freebsd-stable@jyborn.se) Received: (from uucp@localhost) by mailgate.leissner.se (8.14.9/8.14.9/Submit) id t2B9JgXA053655 for ; Wed, 11 Mar 2015 10:19:42 +0100 (CET) (envelope-from list-freebsd-stable@jyborn.se) Received: from pol.leissner.se(192.71.29.17), claiming to be "pol-server.leissner.se" via SMTP by mailgate.leissner.se, id smtpdNDZL7T; Wed Mar 11 10:19:33 2015 Received: from localhost (2968@localhost [local]); by localhost (OpenSMTPD) with ESMTPA id 6abca8f4; for ; Wed, 11 Mar 2015 10:19:33 +0100 (CET) Date: Wed, 11 Mar 2015 10:19:33 +0100 From: Peter Olsson To: freebsd-stable@freebsd.org Subject: Re: There has to be a better way of merging /etc during a major freebsd-update Message-ID: <20150311091933.GM9442@pol-server.leissner.se> References: <20150310120540.GN8223@pol-server.leissner.se> <1d4863fa5d3f1374a9fa5f9bd19d01b7@ultimatedns.net> <20150310220635.GA90305@anubis.morrow.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150310220635.GA90305@anubis.morrow.me.uk> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2015 09:19:47 -0000 On Tue, Mar 10, 2015 at 10:06:37PM +0000, Ben Morrow wrote: > Quoth Peter Olsson : > > > > (But I will try running freebsd-update without merging /etc, > > and use mergemaster -F instead. Should solve my problem.) > > I'm fairly sure this won't do what you want, and in fact won't work at > all, unless your /etc is identical to the stock /etc installed from the > ISO. (Which it isn't, of course.) > > installworld specifically avoids installing the files in /etc; then, > when you run mergemaster, it installs the new versions of those files > into a temporary directory and merges them with the existing /etc. > > freebsd-update works a little differently: because it doesn't have a > source tree available, it has to fetch the stock versions of the files > in /etc for the release you're upgrading from, so that it can patch them > to the new release and then merge the changes into your current /etc. If > you tell freebsd-update to install /etc without merging it will blindly > update files you haven't changed (which is probably what you want) but > (I think) will fail to update the files that you have changed, because > it uses binary patches which won't apply to your modified versions. > > If you want a rather hackish solution, you could try something like > this: > > - Rename /etc to /oldetc. > - Find yourself a copy of the stock /etc for the version you are > upgrading from. (tar -xpf base.txz --include /etc) > - Run freebsd-update with /etc removed from the merge list. This > will (should?) give you a stock /etc for the version you are > upgrading to. > - Rename /etc -> /tmp/etc, /oldetc -> /etc and run mergemaster with > -t /tmp. > > Obviously I would script this if I was doing more than one or two > machines > > Ben I'm not really clear on what will happen if I remove /etc/ from MergeChanges in freebsd-update.conf. Will my /etc then be ignored by freebsd-update, or will my /etc be completely overwritten by freebsd-update? Anyway, your hack could be useful to me. There are no more than about ten files I usually change in /etc, so saving the current /etc, installing a stock /etc, running freebsd-update and then running diff -r to sort out my changes could work. But I'm a little worried about removing my /etc changes from a running server. Thanks! Peter Olsson