From owner-freebsd-questions@FreeBSD.ORG Sat Apr 5 15:45:02 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7265F106564A for ; Sat, 5 Apr 2008 15:45:02 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from hermes.hst.org.za (onix.hst.org.za [209.203.2.133]) by mx1.freebsd.org (Postfix) with ESMTP id 64AD88FC21 for ; Sat, 5 Apr 2008 15:45:00 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from [10.1.11.1] ([10.1.11.1]) (authenticated bits=0) by hermes.hst.org.za (8.13.8/8.13.8) with ESMTP id m35FhfI9057136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 5 Apr 2008 17:43:42 +0200 (SAST) (envelope-from jonathan+freebsd-questions@hst.org.za) From: Jonathan McKeown To: freebsd-questions@freebsd.org Date: Sat, 5 Apr 2008 17:45:04 +0200 User-Agent: KMail/1.9.4 References: <5c99941f0804041923t1e6e9cdbue40e782805fa34f6@mail.gmail.com> In-Reply-To: <5c99941f0804041923t1e6e9cdbue40e782805fa34f6@mail.gmail.com> X-Face: $@VrUx^RHy/}yu]jKf/<4T%/d|F+$j-Ol2"2J$q+%OK1]&/G_S9(=?utf-8?q?HkaQ*=60!=3FYOK=3FY!=27M=60C=0A=09aP=5C9nVPF8Q=7DCilHH8l=3B=7E!4?= =?utf-8?q?2HK6=273lg4J=7Daz?=@1Dqqh:J]M^"YPn*2IWrZON$1+G?oX3@ =?utf-8?q?k=230=0A=0954XDRg=3DYn=5FF-etwot4U=24b?=dTS{i X-Spam-Score: -4.367 () ALL_TRUSTED,AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.61 on 209.203.2.133 Subject: Re: building a distribution server 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: Sat, 05 Apr 2008 15:45:02 -0000 On Saturday 05 April 2008 04:23, Steel City Phantom wrote: > i have about 10 production servers that i want to upgrade to bsd 7 and > update all their ports in one shot. the problem is the down time. im > wrapping up upgrading a 6.3 to 7 and its taken over 7 hours so far. thats > way too long for our machines to be down. > the biggest slow down is the downloading of files. just sitting watching > things i would say 70% of the time is downloading files. is there a way > where i can build a distribution server that has everything i could > possibly need to upgrade a machine from any 6.x to 7.0 and redo all the > ports on that machine and have a cron job keep everything up to date on > that server and when i upgrade a new machine, it simply goes to my internal > distribution server to get the files. I have a fast machine which has the source and ports trees on it. It also has the kernel configurations for all the machines I use (GENERIC, SMP, and two others, IPFWD for a firewall which does IP forwarding and SERIAL for a box which has a multiport serial card in it). That box doesn't do anything else. In its /etc/make.conf is the line KERNCONF=GENERIC SMP IPFWD SERIAL which has the effect of building all four kernels but installing the first-mentioned. Other boxes have their KERNCONF set in make.conf and only need to make installkernel after the build box has finished to get the appropriate one. It also has a full ports tree and I have created the directory /usr/ports/packages (it gets messy if you don't). All the other boxes mount /usr/src, /usr/obj and /usr/ports over NFS. They all use portupgrade which is configured to use /usr/bin/false to fetch packages instead of /usr/bin/fetch. They are also configured to build ports locally but store distfiles and packages on the NFS server. When I build and install a port, I use portupgrade -NRPp which upgrades ports, installing if necessary and building requirements as well (-N -R). It checks for a package in /usr/ports/packages (-P); if it can't find it it checks the 'Net using /usr/bin/false (which of course fails immediately) and then builds from source, creating a package at the end (-p). This means each port gets downloaded once, and then built once if it can be packaged - but it also deals with ports that can't be packaged, like sysutils/screen. By not using -P you can also build the port separately with different options on different machines. Jonathan