From owner-freebsd-questions@FreeBSD.ORG Sat Aug 2 19:55:48 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2BF61065671 for ; Sat, 2 Aug 2008 19:55:48 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.191]) by mx1.freebsd.org (Postfix) with ESMTP id DAACC8FC1B for ; Sat, 2 Aug 2008 19:55:47 +0000 (UTC) (envelope-from reddvinylene@gmail.com) Received: by mu-out-0910.google.com with SMTP id i2so1184044mue.3 for ; Sat, 02 Aug 2008 12:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=DPRfud4+V4tWy7aMgw56AAk6uvOvUNC7ota+5aHU1n4=; b=flo7OmtRURCM+oO9L3QLiEHglhrP7KwPaZbBPo1qTzXtt6EfQH1D17bEKhTa8LJ8E5 qyY0FGdaJ3+o5uVEQabLXnIwX8SVoxFNhkOJrX+65JM7tlciEZNHHtNI7jgiS/kbUCR7 QbskezqZ2PzGiLaSYsk1CMQwTb37i0evtkcVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=JQWbnQ2z4G2HCBqNA1w+bodrFsx9/9mZgkXXwSlmgpXCAzzCq1jyoiHv2JymL6WGd4 SCfCKUq194nKg2WRCly/2/4VNCM8TWy2KtS9OokUx37/SBW9ZPj7QzT8JOHe9XLR6i8P mIn/YeLjX7Q0dMU5UM+R4WFJ+TvAsbidHHgE8= Received: by 10.103.206.12 with SMTP id i12mr4799508muq.33.1217706945553; Sat, 02 Aug 2008 12:55:45 -0700 (PDT) Received: by 10.103.199.5 with HTTP; Sat, 2 Aug 2008 12:55:45 -0700 (PDT) Message-ID: Date: Sat, 2 Aug 2008 21:55:45 +0200 From: "Redd Vinylene" To: questions@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <489398AD.6000900@webanoide.org> <48940CAB.9040001@quip.cz> Cc: Subject: Re: The best way to upgrade my FreeBSD and its jails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Aug 2008 19:55:49 -0000 Sorry, JAILS=/usr/jail for jail in $JAILS/*; do mergemaster -p -D $jail make installworld delete-old delete-old-libs DESTDIR=$jail mergemaster -i -U -D $jail done :) On Sat, Aug 2, 2008 at 9:55 PM, Redd Vinylene wrote: > Sorry, > > JAILS=/usr/jail > > for jail in $JAILS/*; do > > mergemaster -p -D $jail > > make installworld delete-old delete-old-libs DESTDIR=$jail > > mergemaster -i -U -D $jail > > done > > :) > > On Sat, Aug 2, 2008 at 4:26 PM, Redd Vinylene wrote: >> Slight improvement, set -e replaces all the && \: >> >> - >> >> # FreeBSD/i386 mother.naoshige.net >> >> set -e >> >> csup /etc/cvsupfile >> >> cd /usr/src >> >> make buildworld buildkernel >> >> mergemaster -p >> >> make installworld installkernel delete-old delete-old-libs >> >> mergemaster -i -U >> >> JAILS=/usr/local/jails >> >> for jail in $JAILS/*; do >> >> mergemaster -p -D $JAILS/$jail >> >> make installworld delete-old delete-old-libs DESTDIR=$JAILS/$jail >> >> mergemaster -i -U -D $JAILS/$jail >> >> done >> >> chflags -R noschg /usr/obj/* >> >> rm -rf /usr/obj/* >> >> - >> >> Peace! >> >> On Sat, Aug 2, 2008 at 12:03 PM, Redd Vinylene wrote: >>> Thanks a lot guys for your great design insight! >>> >>> I hope others will find this thread interesting as well. Here's the >>> final upgrade script I decided to use (my shell is zsh): >>> >>> - >>> >>> # FreeBSD/i386 mother.naoshige.net >>> >>> csup /etc/cvsupfile >>> >>> cd /usr/src >>> >>> make buildworld buildkernel && \ >>> >>> mergemaster -p && \ >>> >>> make installworld installkernel delete-old delete-old-libs && \ >>> >>> mergemaster -i -U && \ >>> >>> JAILS=/usr/local/jails >>> >>> cd /usr/src >>> >>> for jail in $JAILS/*; do >>> >>> mergemaster -p -D $JAILS/$jail && \ >>> >>> make installworld delete-old delete-old-libs DESTDIR=$JAILS/$jail && \ >>> >>> mergemaster -i -U -D $JAILS/$jail && \ >>> >>> done >>> >>> chflags -R noschg /usr/obj/* >>> >>> rm -rf /usr/obj/* >>> >>> - >>> >>> Much obliged! >>> >>> On Sat, Aug 2, 2008 at 9:28 AM, Miroslav Lachman <000.fbsd@quip.cz> wrote: >>>> Mikhail Goriachev wrote: >>>>> >>>>> Redd Vinylene wrote: >>>>> >>>>>> My dedicated server is mother, its two jails are camel and box. Is >>>>>> this the best way to upgrade all of them? >>>>> >>>>> >>>>> We probably should keep this to freebsd-jail@ only. >>>>> >>>>> Had a look at http://pastie.org/245821 and have a few notes for you: >>>>> >>>>> 1.- As Miroslav already mentioned - it is not a good idea to daisy chain >>>>> everything. You should break the procedure into two steps. Firstly upgrade >>>>> the host and make sure the upgrade went well. Once you're certain that >>>>> everything is ok, then proceed upgrading jails. >>>>> >>>>> I personally disable jails (jail_enable="NO"), then reboot (to avoid any >>>>> zombie jails), perform upgrade on all jails and then enable them back on. >>>>> >>>>> 2.- Your upgrading sequence is a bit off. Have a look at /usr/src/Makefile >>>>> for further details and correct sequence: >>>>> >>>>> # make buildworld >>>>> # make buildkernel >>>>> # make installkernel >>>>> # reboot >>>>> # mergemaster -p >>>>> # make installworld >>>>> # make delete-old >>>>> # mergemaster >>>>> # reboot >>>>> # make delete-old-libs >>>>> >>>>> 3.- You don't need kernels inside your jails. Having them won't hurt you, >>>>> but they consume space. In other words, you shouldn't execute the following >>>>> (or similar): >>>>> >>>>> # make DESTDIR=$D installkernel >>>>> >>>>> 4.- The "make distribution DESTDIR=$D" should be executed only once - when >>>>> a jail is created. Otherwise you're nuking your configurations in jail's >>>>> /etc and probably somewhere else. >>>> >>>> One thing to note - If you do delete-old delete-old-libs you probably need >>>> to recompile all installed ports because of lib dependencies. >>>> >>>>> Have a go at this, you might find some use for it: >>>>> >>>>> ----------------------- >>>>> JAILSDIR=/usr/local/jails >>>>> >>>>> cd /usr/src >>>>> >>>>> for jail in `ls ${JAILSDIR}`; do >>>>> mergemaster -pD ${JAILSDIR}/${jail} >>>>> make installworld DESTDIR=${JAILSDIR}/${jail} >>>>> mergemaster -iD ${JAILSDIR}/${jail} >>>>> done >>>>> ----------------------- >>>> >>> >> > > > > -- > http://www.home.no/reddvinylene > -- http://www.home.no/reddvinylene