portmaster -a on a live server

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Apr 20 19:06:23 UTC 2009


Tom Worster wrote:
> though all i really need is mysql/apache/php i have about 100 ports
> installed and portmaster -a takes a long time to complete (hour or two).
> 
> so i'm wondering if i ought to be concerned about new binaries being
> installed over the old ones on the disk while the old images are loaded and
> running as daemons.
> 
> instead of doing portmaster -a, is there any advantage to:
> 
> portmaster -a -x mysql\-server -x apache
> portmaster mysql\-server apache
> reboot 
> 
> in order to minimize the time that the old servers are running while the new
> images are on the disk?
>

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.

	Cheers,

	Matthew


-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090420/7fbe57c8/signature.pgp


More information about the freebsd-questions mailing list