From owner-freebsd-jail@FreeBSD.ORG Thu Oct 15 18:58:39 2009 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56FE106566C for ; Thu, 15 Oct 2009 18:58:39 +0000 (UTC) (envelope-from ltning@anduin.net) Received: from mail.anduin.net (mail.anduin.net [213.225.74.249]) by mx1.freebsd.org (Postfix) with ESMTP id A2F118FC19 for ; Thu, 15 Oct 2009 18:58:39 +0000 (UTC) Received: from [212.62.248.148] (helo=[192.168.2.172]) by mail.anduin.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MyVX4-000Jww-K8; Thu, 15 Oct 2009 20:58:38 +0200 Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes From: =?iso-8859-1?Q?Eirik_=D8verby?= In-Reply-To: <4AD77075.3010907@optiksecurite.com> Date: Thu, 15 Oct 2009 20:58:38 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4ACE2829.6030804@optiksecurite.com> <295A1256-A620-4DD1-8B7F-22BDB216D164@anduin.net> <4ACE37D6.9040908@optiksecurite.com> <4AD75F8B.10906@optiksecurite.com> <4AD77075.3010907@optiksecurite.com> To: Martin Turgeon X-Mailer: Apple Mail (2.1076) Cc: freebsd-jail@freebsd.org Subject: Re: Can't upgrade jails to 8.0 using freebsd-update X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Oct 2009 18:58:40 -0000 On 15. okt. 2009, at 20.56, Martin Turgeon wrote: > Eirik =D8verby a =E9crit : >> >> On 15. okt. 2009, at 19.44, Martin Turgeon wrote: >> >>> Eirik =D8verby a =E9crit : >>>> >>>> On 8. okt. 2009, at 21.04, Martin Turgeon wrote: >>>> >>>>> Eirik =D8verby a =E9crit : >>>>>> On 8. okt. 2009, at 19.58, Martin Turgeon wrote: >>>>>> >>>>>>> Hi everyone! >>>>>>> >>>>>>> I just upgraded a 7.2-REL to 8.0RC1 using freebsd-update. The =20= >>>>>>> upgrade >>>>>>> went fine on the base system following the procedure written =20 >>>>>>> in the >>>>>>> announcement email by Ken Smith. My problem is when I try to =20 >>>>>>> upgrade my >>>>>>> jails, I get this message: >>>>>>> >>>>>>> # freebsd-update -b /usr/jail/mysql/ fetch install >>>>>>> Looking up update.FreeBSD.org mirrors... 3 mirrors found. >>>>>>> Fetching metadata signature for 8.0-RC1 from =20 >>>>>>> update5.FreeBSD.org... done. >>>>>>> Fetching metadata index... done. >>>>>>> Inspecting system... done. >>>>>>> Preparing to download files... done. >>>>>>> >>>>>>> No updates needed to update system to 8.0-RC1-p0. >>>>>>> No updates are available to install. >>>>>>> Run '/usr/sbin/freebsd-update fetch' first. >>>>>>> >>>>>>> But, if I compare the dates of the files in the base system to =20= >>>>>>> the files >>>>>>> in the jails, it's obvious that the jails are not up to date. >>>>>>> >>>>>>> It seems like freebsd-update doesn't care about the basedir I =20= >>>>>>> specified. >>>>>> >>>>>> It does, but if you do a 'uname -a' - inside or outside the =20 >>>>>> jail - you'll see that it reports the OS revision of the host. =20= >>>>>> So you should have updated your jails first, then the host ... >>>>>> >>>>> Ok but if I update in the process of upgrading the first jail, =20 >>>>> the new kernel will be installed and asked to reboot. After =20 >>>>> that, I will have the same problem when upgrading the other =20 >>>>> jails and the base system, right? There must be something I =20 >>>>> don't understand well. Thanks a lot for your answer. >>>> >>>> The kernel will be installed inside the jail, and the message =20 >>>> about rebooting can be safely ignored. Just run the install =20 >>>> command once more, and you're done and can move on to the next =20 >>>> jail. :) >>>> >>>> /Eirik >>>> >>>> >>>>> Martin >>>>>> One way to get around it is to replace /usr/bin/uname with a =20 >>>>>> shell script, which calls the original uname (which you have =20 >>>>>> renamed) and pipes through something like sed to replace the =20 >>>>>> revision with what you used to have: >>>>>> >>>>>> #!/bin/sh >>>>>> /usr/bin/uname.org $* | sed s/"8.0-RC1-p0"/"7.2-RELEASE_p3"/g >>>>>> >>>>>> And this is a seriously butt ugly hack. >>>>>> >>>>>> /Eirik >>>>>> >>>>>>> Thanks a lot for your help, >>>>>>> >>>>>>> Martin >>>>>>> >>>>>>> >>> Thanks a lot! It worked great, but I'm still concerned by the fact =20= >>> that the world in the jails are from 8.0 while the kernel is still =20= >>> at 7.2 during the updates of the jails. In the normal update =20 >>> procedure, the kernel is upgraded first, rebooted and then the =20 >>> world is updated. It must have a good reason for this. Why can I =20 >>> jail be an exception to this rule? >> >> Because when you upgrade the host, the very binaries you are =20 >> installing are being installed by ... the binaries you are =20 >> installing. Which is why you'll want them to be reasonably in-sync =20= >> with the kernel. >> >> When upgrading jails using freebsd-update, my understanding is that =20= >> it uses the host binaries to push files to the target directory =20 >> (basedir). The risk of trouble is therefore very low (I've upgraded =20= >> dozens of jails from 7.x to 8.0-RC1 without any issues), though I =20 >> can probably imagine situations where this is not the case - i.e. =20 >> if the upgrade depends on functionality in an upgraded binary in =20 >> order to be able to complete the upgrade, however that sounds like =20= >> a very unlikely scenario to me. And *any* use of the basedir option =20= >> to freebsd-update would break in such a case. >> >> /Eirik >> > Sounds reasonable to me. Thanks for your quick reply. Reasonable !=3D true. And for that matter, reasonable !=3D reasonable. =20= YMMV etc. etc. I haven't peeked (much) into the code, so I'm just =20 guessing from my experiences. ;) People in the know should correct me if I'm wrong.. /Eirik=