Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2009 11:37:06 -0400
From:      Tom Worster <fsb@thefsb.org>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: portmaster -a on a live server
Message-ID:  <C614B1E2.9A9A%fsb@thefsb.org>
In-Reply-To: <49ECC7A5.8020002@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/20/09 3:06 PM, "Matthew Seaman" <m.seaman@infracaninophile.co.uk>
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. 





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C614B1E2.9A9A%fsb>