Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Apr 2013 14:38:08 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Perry Hutchison <perryh@pluto.rain.com>
Cc:        d@delphij.net, freebsd-ports@freebsd.org
Subject:   Re: non-destructive ports/packages update
Message-ID:  <20130421113808.GA5485@straylight.m.ringlet.net>
In-Reply-To: <51733ad5.jgrImeJZdbQoq4dt%perryh@pluto.rain.com>
References:  <517236fe.7AoqFIleDJvljza6%perryh@pluto.rain.com> <51723A51.20401@delphij.net> <51733ad5.jgrImeJZdbQoq4dt%perryh@pluto.rain.com>

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

[-- Attachment #1 --]
On Sat, Apr 20, 2013 at 06:03:17PM -0700, Perry Hutchison wrote:
> Xin Li <delphij@delphij.net> wrote:
> 
> > On 4/19/13 11:34 PM, Perry Hutchison wrote:
> > > I'm looking for a way to move everything connected with ports and 
> > > packages aside, so that I can start fresh but with the ability to 
> > > easily roll it back when things go badly (as they surely will).
> > > 
> > > I have in mind to something like this:
> > > 
> > > # cd /usr
> > > # mkdir old
> > > # mv ports local old
> > > # mkdir ports local
> > > # cd /var/db
> > > # mkdir old
> > > # mv ports pkg old
> > > # mkdir ports pkg
> > > 
> > > Is there anything else that needs to be saved before fetching a
> > > new ports tree and starting to build things (or install prebuilt 
> > > packages)?
> >
> > If you use ZFS, it's possible to take snapshot, then install new
> > ports, then if something blows up, you can rollback.
> >
> > With UFS, it's still possible to take snapshot but rollback is not
> > atomic.
> 
> I'm aware of filesystem snapshots, but I only want to checkpoint the
> ports and packages, not the whole filesystem -- a rollback needs to
> be fast, easy, and obviously correct; preserve the failure logs; and
> not undo changes that may have been made elsewhere in the meantime.
> (BTW I don't use ZFS:  the machine doesn't have enough memory, and to
> me ZFS -- especially on 8.x -- doesn't yet seem sufficiently proven.)
> 
> > If you use portmaster, it can save packages (I think portupgrade
> > can do it too).  But this approach depends on the fact that the
> > port is well written, and is not atomic in terms of package set.
> 
> And then a rollback requires re-installing the saved packages, which
> is surely slower than moving a few directories and/or files around.
> 
> The question is, what (if anything) else -- besides /usr/ports,
> /usr/local, /var/db/ports, and /var/db/pkg -- needs to be checkpointed?

Some ports might store "run state" in /var/db/<portname> or a similarly
named directory.  The thing is, the decision whether to save this and
restore it or to keep it across runs actually depends on the port: for
database management systems such as MySQL, PostgreSQL, etc, you'll
probably want to keep the databases even if the ports themselves are
reinstalled, rolled back, restored, whatever.  For some other systems,
you might want to remove the "current state" information of the version
that you are about to replace.

G'luck,
Peter

-- 
Peter Pentchev	roam@ringlet.net roam@FreeBSD.org p.penchev@storpool.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
Thit sentence is not self-referential because "thit" is not a word.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJRc8+bAAoJEGUe77AlJ98TuHUP/3yt8FOL37oT9+gh+D9X9FC4
YwuDKIn+k0Zu1r/iIbgoriVociPIZdc9sgN5AfPyOUXy/frcHtAx/0MYqqDhV9oY
xM/UcvnWqOn21DfV8GtuwMVgG0IcCtm7iMSIboA7NVlx0H+dNvJ0Sfg3m0cVyCu2
Lkp1XP54zxmIt8+Xf9Zq57LCl9AP7SkVpafJdsbhZ2TaNV2iammn2WUMNDbIjLeK
LxBEKE/+ltk2Aw9FS5Pve0ZyRLwMgZfj9D5YvyQPUhRtPIMvQ0utLRzgNPMKI7P8
T68T/LzRm7cNh2o/ROZuEHNZym+icLRQ7Y36OU0z9PQJ+RgdwQef+uQUnmt6qVx7
+WRmVJCAU9BCk6DBqlDiINLbP1FHzZmg3mVuk1LIUsm/in7Dq8JJ7U/L7MKNV21p
bj+Ox8H4AiZ1XUsqlHtBjxuqubSlhTmTmJq1U2+EcBbdykSLMnNVorL58gvdls0z
FTJpACcJZYxMKKMUq7SG9A0WEIzQhAQOC2TeN5vPphuLNkB25fAgJV7WogbI7/cu
sSBL5ny3YYZlbMUL8pL+y3tBJmUGl+cqJPUXtcspE9VS+6FMT4bAaDlTSzo6N5WD
W0MX6cz9KpC2DGasVpNDt1x0CitjmKhBougilQ9+Ye4MsyHgKc2759ZG/qHl4MbD
KA62xBtFtpl43aURd0O4
=SCMO
-----END PGP SIGNATURE-----

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