[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] Best way to upgrade a ezjail system with freebsd-update

On 12.06.2014 2:42, Simeó Reig wrote:
> Hello
>   I need to upgrade a freebsd machine thats nowadays runs under 9.0 to
> 9.2. Is this correct?

One day I faced almost the same problem, and understood that
ezjail-admin update functionality is not enough to properly update the
jails. Here's my mail to this mailing list

> Hi everyone,
> Recently I was updating my box to from 9.2-RELEASE to 10-RELEASE using
> freebsd-update
> First thing I noticed - "ezjail-admin update -U" not only doesn't
> update /etc and /var directories of jails, but also it calls
> "freebsd-update install" in the basejail again and again until it
> exists with error "nothing to install, please fetch". On the third
> step freebsd-update deletes obsolete library files, so when I started
> all my jails 80% of software installed from ports just didn't start.
> Freebsd-update stops after each step for a reason, so if I updated
> basejail and jails by hand i could just stop after the second step,
> rebuild all ports (as recommended by handbook) in all my jails and
> only then run freebsd-update on the basejail for the third time,
> getting almost zero downtime. Thankfully before doing this on the
> production server I duplicated it to my virtualbox vm (using zfs send
> | zfs receive) and tried it. Then I rolled back and tried to make
> upgrade by hand. I created two freebsd-update.conf files: one for
> basejail, one for jails. The point was to specify IgnorePaths,
> Components and StrictComponents correctly:
> For the basejail (freebsd-update-basejail.conf):
> Components world/base world/lib32
> IgnorePaths /etc /root /var /usr/games /usr/home /usr/local /usr/obj
> /usr/tests
> StrictComponents yes
> For jails (freebsd-update-jails.conf):
> Components world/base
> IgnorePaths /bin /boot /home /lib /libexec /proc /rescue /sbin /sys /tmp \
> /usr/bin /usr/sbin /usr/include /usr/lib /usr/lib32 /usr/libdata
> /usr/libexec \
> /usr/share /usr/src
> StrictComponents yes
> (I know that IgnorePaths contain redundant entries)
> Then I upgraded my basejail using
> # UNAME_r="9.2-RELEASE" freebsd-update -b /usr/jails/basejail -f
> freebsd-update-basejail.conf -r 10.0-RELEASE upgrade
> And then
> # freebsd-update -b /usr/jails/basejail -f
> freebsd-update-basejail.conf install
> again and again
> Jails:
> # for i in jail_foo jail_bar jail_baz
> # do
> # UNAME_r="9.2-RELEASE" freebsd-update -b /usr/jails/$i -f
> freebsd-update-jails.conf -r 10.0-RELEASE upgrade
> # done
> And then
> # for i in jail_foo jail_bar jail_baz
> # do
> # freebsd-update -b /usr/jails/$i -f freebsd-update-jails.conf install
> # done
> again and again
> IMHO ezjail-admin -U option must be considered harmful in this
> implementation, and must be rewritten.
> I want to help and I would like to provide patches as soon as I have
> time to write them
> Best regards,
> Kozlov Sergey.