From owner-freebsd-isp Sun Jul 21 10:56: 6 2002 Delivered-To: freebsd-isp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0F9737B400 for ; Sun, 21 Jul 2002 10:56:01 -0700 (PDT) Received: from alydar.infoteam.com (alydar.infoteam.com [207.246.83.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7496243E31 for ; Sun, 21 Jul 2002 10:56:01 -0700 (PDT) (envelope-from kmartin@infoteam.com) Received: from [10.0.0.10] (yoda.ksm.com [207.87.82.146]) by alydar.infoteam.com (Postfix) with ESMTP id 940EE6E737 for ; Sun, 21 Jul 2002 13:56:00 -0400 (EDT) Date: Sun, 21 Jul 2002 13:56:01 -0400 From: Kenn Martin Reply-To: Kenn Martin To: freebsd-isp@FreeBSD.ORG Subject: Re: remote system upgrade Message-ID: <232832815.1027259761@[10.0.0.10]> In-Reply-To: <20020721103515.GA68498@amor.yuckfou.org> References: <20020721030144.GA865@lonerx> <20020721103515.GA68498@amor.yuckfou.org> X-Mailer: Mulberry/3.0.0a3 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --On Sunday, July 21, 2002 12:35 PM +0200 Nils Vogels wrote: > Hi Ivan,, > > On Sun, Jul 21, 2002 at 07:01:44AM +0400, LonerX wrote: >> All we know how much cvsup and following makes mean for a system. But >> being able to cvsup the sources on my remote server and being able to >> build the world I cannot find the way to 'make installworld' remotely. >> If somebody has experience in that and can share it with me I'll be >> really glad and grateful to know about it. > > I do it all the time, like this: We do this quite often as well, with a few differences: > 1) sync your sourcetree using cvsup: > # cd /usr/src > # make update Our build machine's /etc/make.conf has the cvsup bits set and pointing to /etc/cvsup.conf, but we do this step in the same make call as buildworld. > 2) Read /usr/src/UPDATING, do whatever is needed according to that file > 3) Rebuild your kernel and world > # make buildkernel KERNCONF=MYCONF > # make buildworld Our build script (below) does make buildworld first, and then a buildkernel with multiple machine configs. We always check the end of the log for the error count (must be zero) before continuing. The target machine(s) use NFS mounts to the build machine's /usr/obj and /usr/src. Then cd /usr/src > 4) If all this went well, install the new kernel and world > # make installkernel KERNCONF=MYCONF At this point, depending on the target machine's work load, we stop as many daemons as possible (e.g. named, httpd, etc.). This is really a business decision on whether that functionality can be down another couple minutes (in addition to the ultimate time involved in the cycling of the machine). > # make installworld > 5) Merge configfiles, since installworld (luckily) doesnt do this > # mergemaster To speed this up a bit, we have an /etc/mergemaster.rc with AUTO_INSTALL=yes COMP_CONFS=yes IGNORE_MOTD=yes which automatically installs any files that don't already exist and then gives a diff of just the settings you use in /etc/rc.conf > 6) # shutdown -r +5 'Now entering the new world ..' Or, if you don't have anyone to notify and you need to save time: # shutdown -r now Our buildall script (build machine only) ... We invoke this from a cron job every Saturday morning. If there is an urgent security fix needed, we can obviously run it any other time as well. No installs are ever done automatically and weeks may go by before we actually use one of these builds. Regardless, we always have a recent build ready to go if we find a need for any existing or new machine. -----8<----- #!/bin/sh LOGFILE=/tmp/buildall.log mv $LOGFILE $LOGFILE.0 echo '--------------------------------------------------------------' > $LOGFILE echo -n 'buildall started: ' >> $LOGFILE date >> $LOGFILE # cleanup echo '>>> Cleaning /usr/obj' >> $LOGFILE rm -rf /usr/obj/usr chflags -R noschg /usr/obj/usr rm -rf /usr/obj/usr echo -n ' complete: ' >> $LOGFILE date >> $LOGFILE # build userland cd /usr/src /usr/bin/make update buildworld >> $LOGFILE echo -n 'buildworld complete: ' >> $LOGFILE date >> $LOGFILE # build all kernels /usr/bin/make buildkernel KERNCONF="GENERIC KFW KMS KWS" >> $LOGFILE echo -n 'buildkernel(s) complete: ' >> $LOGFILE date >> $LOGFILE echo -n 'error count: ' >> $LOGFILE grep -c 'Error code' $LOGFILE >> $LOGFILE ----->8----- -- Kenn Martin InfoTeam Corp. voice/fax (work): 877 819 0414 voice/fax (home): 877 594 3375 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message