From owner-freebsd-questions@FreeBSD.ORG Tue Apr 17 23:06:45 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A9DF16A402 for ; Tue, 17 Apr 2007 23:06:45 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from ezekiel.daleco.biz (southernuniform.com [66.76.92.18]) by mx1.freebsd.org (Postfix) with ESMTP id EB9BA13C459 for ; Tue, 17 Apr 2007 23:06:44 +0000 (UTC) (envelope-from kdk@daleco.biz) Received: from archangel.daleco.biz ([69.27.149.254]) by ezekiel.daleco.biz (8.13.8/8.13.1) with ESMTP id l3HN6b78017703; Tue, 17 Apr 2007 18:06:38 -0500 (CDT) (envelope-from kdk@daleco.biz) Message-ID: <462552F7.7000500@daleco.biz> Date: Tue, 17 Apr 2007 18:06:31 -0500 From: Kevin Kinsey User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.2pre) Gecko/20070221 SeaMonkey/1.1 MIME-Version: 1.0 To: Michael Grant References: <62b856460704170112x7bae258dm5aede163b203a85b@mail.gmail.com> <20070417091026.GA17020@demeter.hydra> <14989d6e0704170249v486f3ad9vc5c8df53378229ca@mail.gmail.com> <62b856460704170558i59cbe4c9m2b222af0e72af4ce@mail.gmail.com> <20070417211241.GB48816@demeter.hydra> In-Reply-To: <20070417211241.GB48816@demeter.hydra> Content-Type: multipart/mixed; boundary="------------080103080307090808060307" Cc: Chad Perrin , FreeBSD Questions Subject: Re: keeping all things up to date 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: Tue, 17 Apr 2007 23:06:45 -0000 This is a multi-part message in MIME format. --------------080103080307090808060307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Chad Perrin wrote: > If you have specific ideas about what parts of the updating process are > "safe", you might try writing a few shell or Perl scripts that automate > those steps -- then share them with the rest of the world. You might > also, if writing such scripts is too far outside your expertise, simply > put together a carefully crafted list of steps you think should be taken > so you can pass it on to others like myself who might be more likely to > write the code (at which point I/he/she can give it back to you for your > own use). This is possible - perhaps even trivial. Of course, when something breaks, you're off to get a console, whether it's the next office over or a thousand miles away. Attached is a modified version of what I use on some of our machines, for OS only, if anyone wants a "starting point". It's part of a "larger system" I'll probably never finish. It's pretty simple, amateurish even ... no tests, etc. Since we know it works for us, didn't figure it was needed. YMMV, BSD license, include #, etc. Kevin Kinsey -- You can observe a lot just by watching. -- Yogi Berra --------------080103080307090808060307 Content-Type: text/plain; name="worldupdate" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="worldupdate" #! /bin/sh #DEFINE THE FOLLOWING: #Csup program CSUP="/usr/local/bin/cvsup" #Kernel file $KERNFILE="$SRCTREE/sys/i386/conf/GENERIC" #Log Directory LOGDIR="~/buildlogs" #Admin's mail address MAIL2="me@mydomain.com" #path to source tree SRCTREE="/usr/src" #source supfile SRC_SUPFILE="/stable-supfile" #temp dir TMPD="$TMPD" # More defines HOST=`hostname` SCRIPT=`realpath $0` SCRIPTDIR=`realpath .` $MSG="updatemsg.txt" echo "$HOST successfully built a GENERIC kernel plus Firewall, Divert and Dummynet options. " > $SCRIPTDIR/updatemsg.txt # Get to proper wd and update the source tree cd $SRCTREE; $CSUP $SRC_SUPFILE > $LOGDIR/src.cvsup 2>&1 #report and clean up echo "$HOST cvsup script reporting" > $TMPD/buildlogfoo echo "\n" >> $TMPD/buildlogfoo tail $LOGDIR/src.cvsup >> $TMPD/buildlogfoo cat $TMPD/buildlogfoo | mail -s "Server Report $HOST CVSup" $MAIL2 rm $TMPD/buildlogfoo # Next step: build the world make buildworld > $LOGDIR/buildworld 2>&1 # report and clean up echo "$HOST buildworld script reporting" > $TMPD/buildlogfoo echo "\n" >> $TMPD/buildlogfoo tail $LOGDIR/buildworld >> $TMPD/buildlogfoo cat $TMPD/buildlogfoo | mail -s "Server Report $HOST Buildworld" $MAIL2 rm $TMPD/buildlogfoo # Set up kernel options for Firewall, Nat, Dummynet echo " " >> $KERNFILE echo "# added by $SCRIPT " >> $KERNFILE echo " " >> $KERNFILE echo "options IPFIREWALL" >> $KERNFILE echo "options IPFIREWALL_VERBOSE_LIMIT=10" >> $KERNFILE echo "options IPDIVERT" >> $KERNFILE echo "options DUMMYNET" >> $KERNFILE echo "options HZ=1000" >> $KERNFILE echo " " >> $KERNFILE # Build the kernel make buildkernel > $LOGDIR/kernel 2>&1 tail $LOGDIR/kernel > $TMPD/kernelfoobuild cat $SCRIPTDIR/$MSG $TMPD/kernelfoobuild | mail -s "$HOST Kernel Build Report" $MAIL2 rm $TMPD/kernelfoobuild # Install the new kernel make installkernel > $LOGDIR/kern.inst 2>&1 echo "Report on kernel installation from $HOST" >> $TMPD/kernelinstallfoo cat $TMPD/kernelinstallfoo $LOGDIR/kern.inst | mail -s "$HOST kernel install report" $MAIL2 rm $TMPD/kernelinstallfoo exit 0; --------------080103080307090808060307--