Re: portmaster -a on a live server

2009-04-26 Thread Mel Flynn
On Sunday 26 April 2009 01:12:48 Tom Worster wrote:

> thanks for the tip, mel. i got rid of the ports involved and reinstalled
> with WITHOUT_X11=yes and the install was faster and things are a lot
> tidier.
>
> i had no idea that i ought to be configuring port builds with env vars. is
> there documentation anywhere so i find out about these options in gneral?

/usr/ports/Mk/bsd.port.mk comments section and /usr/ports/Mk/bsd.*.mk for 
specific collections, like bsd.databases.mk lets you set a default version for 
various database engines, for which multiple versions exist in the port.

It does not have to be env vars, make.conf works as well, but you will forget 
in 3 months you have set it, so be careful what you choose and where you put 
it.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-25 Thread Tom Worster
On 4/23/09 12:54 AM, "Mel Flynn"
 wrote:

> On Wednesday 22 April 2009 17:37:06 Tom Worster wrote:
> 
>> 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.
> 
> Wrong assumption. php-gd doesn't depend on python at all. devel/apr does, so
> you've built php with apache module and that pulls in python OR you didn't set
> WITHOUT_X11=yes when building, so libxcb is pulled in which uses python:
> 
> % sudo /stable/root/bin/finddep.php graphics/php5-gd lang/python26
> /usr/ports/x11/xcb-proto: /usr/local/bin/python2.6 => /usr/ports/lang/python26
> /usr/ports/x11/xcb-proto: /usr/local/bin/python2.6 => /usr/ports/lang/python26
> /usr/ports/x11/libxcb: /usr/local/bin/python2.6 => /usr/ports/lang/python26
> /usr/ports/x11/libxcb: /usr/local/bin/python2.6 => /usr/ports/lang/python26
> /usr/ports/devel/apr: /usr/local/bin/python2.6 => /usr/ports/lang/python26
> 
> % sudo env WITHOUT_X11=yes /stable/root/bin/finddep.php graphics/php5-gd
> lang/python26
> /usr/ports/devel/apr: /usr/local/bin/python2.6 => /usr/ports/lang/python26

thanks for the tip, mel. i got rid of the ports involved and reinstalled
with WITHOUT_X11=yes and the install was faster and things are a lot tidier.

i had no idea that i ought to be configuring port builds with env vars. is
there documentation anywhere so i find out about these options in gneral?



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-22 Thread Mel Flynn
On Wednesday 22 April 2009 17:37:06 Tom Worster wrote:

> 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.

Wrong assumption. php-gd doesn't depend on python at all. devel/apr does, so 
you've built php with apache module and that pulls in python OR you didn't set 
WITHOUT_X11=yes when building, so libxcb is pulled in which uses python:

% sudo /stable/root/bin/finddep.php graphics/php5-gd lang/python26
/usr/ports/x11/xcb-proto: /usr/local/bin/python2.6 => /usr/ports/lang/python26
/usr/ports/x11/xcb-proto: /usr/local/bin/python2.6 => /usr/ports/lang/python26
/usr/ports/x11/libxcb: /usr/local/bin/python2.6 => /usr/ports/lang/python26
/usr/ports/x11/libxcb: /usr/local/bin/python2.6 => /usr/ports/lang/python26
/usr/ports/devel/apr: /usr/local/bin/python2.6 => /usr/ports/lang/python26

% sudo env WITHOUT_X11=yes /stable/root/bin/finddep.php graphics/php5-gd 
lang/python26
/usr/ports/devel/apr: /usr/local/bin/python2.6 => /usr/ports/lang/python26

-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-22 Thread Tom Worster
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. 


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-21 Thread Mel Flynn
On Tuesday 21 April 2009 01:38:26 Tom Worster wrote:

> portmaster -a -x mysql-server
> portmaster mysql-server
> reboot

No no no. /usr/local/etc/rc.d/mysql-server start. Reboot is for kernel 
upgrades. And never use reboot unless in single user mode, cause reboot is 
really fast reboot: it doesn't stop services nicely. Use shutdown -r now.
-- 
Mel
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-20 Thread Tom Worster
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.

so i'll try

portmaster -a -x mysql-server
portmaster mysql-server
reboot

which might work ok as mysql-server is a leaf node in my config


> 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.

it's finding the optimum between minimizing downtime and having enough that
i'm trying to think through.

thanks for your remarks.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-20 Thread Tim Judd
On Mon, Apr 20, 2009 at 12:47 PM, 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?
>
> tom
>


Matthew has reported that he's had success with ports automatically
restarting themselves, whereas I've not seen that happen.

I had started (abandoned now) a script that would dynamically ask the rc.d
system if a package was running when it was time to install a new package,
meaning that it needs to stop, install, and start the package during the
upgrade process.  Worked well, until I realized that lots of ports don't do
much (if any) work until make install is called, then it will (of all
things) download and install depenencies and itself.  So while all the
dependencies are being downloaded and installed, the original package that
needed to be upgrade has not been running.  On large upgrades for the sake
of anything better to example, Xorg, KDE/Gnome, MySQL/PostgreSQL all were
NOT running during the 'install' phase which should be quick.  Instead due
to the Makefile writing it was delaying the install and restart of the
packages anywhere from minutes to hours (to days..  OpenOffice).



I abandoned the project mostly because I found little things about the ports
system that is invisible to most people, but when dealing with the ports
system details, they were the sore thumb.

Since then I've found portmanager/portmaster/portupgrade have improved so
now it's time to improve their stuff in terms of patches and upgrades.


YMMV, I just didn't see the success Matthew had.


--Tim
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: portmaster -a on a live server

2009-04-20 Thread Matthew Seaman

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



signature.asc
Description: OpenPGP digital signature


portmaster -a on a live server

2009-04-20 Thread Tom Worster
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?

tom


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"