From owner-freebsd-questions@FreeBSD.ORG Thu Apr 21 05:32:51 2005 Return-Path: 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 CC39616A4CE for ; Thu, 21 Apr 2005 05:32:51 +0000 (GMT) Received: from cobalt.antimatter.net (cobalt.antimatter.net [69.55.224.239]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5716643D2D for ; Thu, 21 Apr 2005 05:32:51 +0000 (GMT) (envelope-from glenn@antimatter.net) Received: from glenn-mobile.antimatter.net (cpe-66-27-94-59.san.res.rr.com [66.27.94.59]) (authenticated bits=0)j3L5WkR4027035 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NO); Wed, 20 Apr 2005 22:32:47 -0700 Message-Id: <6.1.0.6.2.20050420222544.03491080@cobalt.antimatter.net> X-Sender: lists@cobalt.antimatter.net X-Mailer: QUALCOMM Windows Eudora Version 6.1.0.6 Date: Wed, 20 Apr 2005 22:31:53 -0700 To: Kevin Kinsey , "W. D." From: Glenn Dawson In-Reply-To: <42672ACE.1020306@daleco.biz> References: <426698CE.3040307@speakeasy.net> <426686A2.4030303@gmx.net> <426698CE.3040307@speakeasy.net> <5.1.0.14.2.20050420213634.2d47e270@209.152.117.178> <42672ACE.1020306@daleco.biz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed cc: questions@freebsd.org Subject: Re: FreeBSD vs Linux X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2005 05:32:52 -0000 At 09:23 PM 4/20/2005, Kevin Kinsey wrote: >Nothing spectacular, to be sure. I simply noticed that I >have done a lot of things to set up a server or whatever, >and they can easily be scripted. I'm certainly no shell >scripting expert (A month ago I would have tried this >in PHP, but there's a little "chicken/egg" problem there, >and /bin/sh is really made for this stuff). Here's the rough outline: > >1. Install a base system manually with sysinstall. Make >sure that a source tree and ports tree exists by some manual >means (like the aforementioned sysinstall). Make sure in BIOS >that the system will boot with a floppy in the drive (priority to >HD). > >2. On a floppy I have three scripts, we'll call 'em >"install", "setup1", "setup2"; and supfiles for >-STABLE and ports. Mount the floppy and run >"install" with a $SERVERTYPE argument .... > >3. "install" copies the supfiles from floppy to >a location on the machine's filesystem. It then >copies "setup1" and "setup2" to /tmp/ and makes >sure that they are executable. Having received >an argument that tells the script what type of >machine we're setting up, it calls /tmp/setup1 >with that argument.... > >4. "setup1" checks for the existence of the >ports tree, then builds cvsup-without-gui >from ports. (This seems to be one Achilles tendon). >It then runs cvsup on the src tree, builds world, >builds a generic kernel, installs it, copies root's >crontab to /tmp/ and adds an "@reboot" command >pointing to /tmp/setup2 with the server type argument >to the root crontab. It then calls "shutdown -r". > >5. When the machine comes back up on the new >kernel, cron calls "setup2", which sleeps a little >(?maybe?) and then does some checks and installs >the newly created world. I've not decided how to >handle mergemaster. Setup2 adjusts make.conf >and builds a list of ports to be installed based on >the command line argument. The ports tree >gets cvsupped, and each port is installed in >turn. The backup copy of root's crontab is >restored to its proper place so that the script >isn't called anymore. The scripts deletes as >much of my stuff as possible, and exits. > >That's about the size of it. My code isn't pretty, >as I'm not real experienced with /bin/sh, but >after some testing I might get it out for viewing, >although it seems simple enough (to me) that >anyone could follow this outline and make it >happen for themselves...IOW, I can't believe that >somebody out there doesn't have something like >this already, and I'm quite sure that they do, (unless >maybe they just image HD's instead?) > >And I see no reason why it couldn't be expanded >to do a lot of other stuff as well. Scripting is just >"doing what you'd do yourself" in code, so you can >do something else, after all...I used to sit at terminals >and watch "buildworld" happen ... now I'm generally >past that ;-) although I've not yet been brave enough >to have my buildworld scripts call "shutdown" for >themselves on my production boxes.... Most of this seems like it could be much more easily handled with something like cfengine (/usr/ports/sysutils/cfengine, and http://www.cfengine.org/). Especially when adding machines to an existing network with similarly configured systems. -Glenn >Kevin Kinsey >_______________________________________________ >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"