From owner-freebsd-questions@FreeBSD.ORG Wed Oct 4 15:08:53 2006 Return-Path: X-Original-To: questions@freebsd.org Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6997216A40F for ; Wed, 4 Oct 2006 15:08:53 +0000 (UTC) (envelope-from i.tanusheff@procreditbank.bg) Received: from mailgate.procreditbank.bg (mailgate.procreditbank.bg [193.26.216.3]) by mx1.FreeBSD.org (Postfix) with SMTP id 95AC743D72 for ; Wed, 4 Oct 2006 15:08:44 +0000 (GMT) (envelope-from i.tanusheff@procreditbank.bg) Received: (qmail 85592 invoked from network); 4 Oct 2006 17:10:01 +0300 Received: by simscan 1.1.0 ppid: 85580, pid: 85581, t: 1.9833s scanners: attach: 1.1.0 clamav: 0.88.4/m:40/d:1994 spam: 3.1.5 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on mailgate.procreditbank.bg X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=ham version=3.1.5 Received: from unknown (HELO lotus.procreditbank.bg) (172.16.248.123) by 192.168.1.3 with SMTP; 4 Oct 2006 17:09:59 +0300 In-Reply-To: <7B0D645C-4EA3-4249-B7EB-5833F23824EF@gmail.com> To: futhwo MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0 August 18, 2005 From: Ivailo Tanusheff Message-ID: Date: Wed, 4 Oct 2006 17:00:45 +0300 X-MIMETrack: Serialize by Router on DOMINO_HQ/PROCREDITBANK(Release 7.0|August 18, 2005) at 10/04/2006 05:00:46 PM, Serialize complete at 10/04/2006 05:00:46 PM Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Questions , owner-freebsd-questions@freebsd.org Subject: Re: Updating 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: Wed, 04 Oct 2006 15:08:53 -0000 I may give you a script how to update ports in the jails. You just need to have the same ports installed on your base system and build them with making a package ready for instalation. Personally I use: PACKAGES=/usr/ports/packages /usr/local/sbin/portupgrade -v -i -a -y -p Then if you have made jails in /usr/local/jails use the following script: #!/bin/sh echo "***********************************" echo "* *" echo "* Preparing mount points *" echo "* *" echo "***********************************" /sbin/mount_nullfs /usr/ports/ /usr/local/jails//usr/ports /sbin/mount_nullfs /usr/ports/ /usr/local/jails//usr/ports ... /sbin/mount_nullfs /usr/ports/ /usr/local/jails//usr/ports echo "" echo "" echo "***********************************" echo "* *" echo "* Executing update script *" echo "* *" echo "***********************************" echo "" echo "" for jid in `/usr/sbin/jls | /usr/bin/cut -c 1-6`; do if [ $jid != "JID" ]; then echo "Updating:" echo `/usr/sbin/jls | /usr/bin/grep JID` echo `/usr/sbin/jls | /usr/bin/grep " $jid "` echo -n "Continue with upgrade [y/n]: " read oks if [ "x$oks" = "xn" -o "x$oks" = "xN" ]; then echo "Skipping JID=$jid" echo "" echo "" else /usr/sbin/jexec $jid /usr/local/bin/updateports.sh fi fi done echo "" echo "" echo "***********************************" echo "* *" echo "* Removing mount points *" echo "* *" echo "***********************************" echo "" echo "" /sbin/umount /usr/local/jails//usr/ports /sbin/umount /usr/local/jails//usr/ports .... /sbin/umount /usr/local/jails//usr/ports This asks you for updating particular jail and executes /usr/local/bin/updateports.sh in each jail (you should copy it in every jail). You can use this: #!/usr/local/bin/bash echo "************************************************" echo "* *" echo "* Updating indexes *" echo "* *" echo "************************************************" /usr/local/sbin/portsdb -u echo "************************************************" echo "* *" echo "* Fixing database *" echo "* *" echo "************************************************" /usr/local/sbin/pkgdb -Fv echo "************************************************" echo "* *" echo "* Updating ports *" echo "* *" echo "************************************************" /usr/local/sbin/portupgrade -v -i -a -y -f -PP That is what I use in my jails. Hope this will help you :) Regards, Ivailo Tanusheff Deputy Head of IT Department ProCredit Bank (Bulgaria) AD futhwo Sent by: owner-freebsd-questions@freebsd.org 04.10.2006 16:24 To FreeBSD Questions cc Subject Updating jails Hi We have an infrastructure composed by a few physical servers that contains some full jails (up to 10 jails per server). I am wondering what's the better and fastest way to bring the jails up-to-date when a new patchlevel or minor version is released and installed on the host system. This method would better be unattended, but it's not a requirement. Hi Ivan _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"