Date: Sun, 21 Jul 2002 13:56:01 -0400 From: Kenn Martin <kmartin@infoteam.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--On Sunday, July 21, 2002 12:35 PM +0200 Nils Vogels <nivo+freebsd-isp@yuckfou.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?232832815.1027259761>