From owner-freebsd-questions@FreeBSD.ORG Wed Apr 22 15:37:11 2009 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 F29DC106567E for ; Wed, 22 Apr 2009 15:37:11 +0000 (UTC) (envelope-from fsb@thefsb.org) Received: from smtp154.iad.emailsrvr.com (smtp154.iad.emailsrvr.com [207.97.245.154]) by mx1.freebsd.org (Postfix) with ESMTP id CAC0A8FC22 for ; Wed, 22 Apr 2009 15:37:11 +0000 (UTC) (envelope-from fsb@thefsb.org) Received: from relay25.relay.iad.mlsrvr.com (localhost [127.0.0.1]) by relay25.relay.iad.mlsrvr.com (SMTP Server) with ESMTP id 4E0391B400D; Wed, 22 Apr 2009 11:37:11 -0400 (EDT) Received: by relay25.relay.iad.mlsrvr.com (Authenticated sender: fsb-AT-thefsb.org) with ESMTPSA id 24A661B40CD; Wed, 22 Apr 2009 11:37:10 -0400 (EDT) User-Agent: Microsoft-Entourage/12.10.0.080409 Date: Wed, 22 Apr 2009 11:37:06 -0400 From: Tom Worster To: Matthew Seaman Message-ID: Thread-Topic: portmaster -a on a live server Thread-Index: AcnDYDDQuIRiuE2/J0mVu+Neup66VQ== In-Reply-To: <49ECC7A5.8020002@infracaninophile.co.uk> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: portmaster -a on a live 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: Wed, 22 Apr 2009 15:37:12 -0000 On 4/20/09 3:06 PM, "Matthew Seaman" wrote: > Many ports will shut down a running instance of themselves when upgraded > like this specifically to avoid the sort of complications that can occur > when the running image does not match what is on disk. > > mysql does, apache doesn't. > > So upgrade mysql-server last thing before you reboot. Although I know you're > not using portupgrade, this snippet from pkgtools.conf has been a blessing in > minimizing outage lengths during updates on live servers: > > AFTERINSTALL = { > '*' => proc { |origin| > cmd_start_rc(origin) > }, > } > > Of couse, the best course of action is to plan sufficient downtime that you > can do the upgrades comfortably plus recover from any number of ways things > might go wrong, but sometimes that simply isn't possible. i went through the process with portmaster on a test machine. it's exactly as you describe. the old apache keeps running. mysql runs throughout the build until the install, when it stops. a down and dirty way could be to just enter these three commands all at once: portmaster -agbtvwuD -x mysql\-server portmaster -gbtvwuD mysql\-server mysqld_safe & i could test the exit code of portmaster on the second and third lines and abandon if !=0 but i'm not sure it would add much. watching the process is very dreary. i found listening to an audio book helped. by the by, on my test machine i ended up with python installed. seems to be because i needed php5-gd which now depends on python. all for some simple freetype2 calls.