Upgrading ports via (p)ssh (non-interactive)

I've been searching for a while how to upgrade ports on FreeBSD machines without really having to login to them (non-interactive). For instance, if you have 300 machines that need an update of lang/rub18 (when Ruby is only used for ports-mgmt/portupgrade one could do such a thing without any risc), it would be very easy and fast to use security/pssh for this. Something like this:

Code:
# pssh -i -t 0 -l admin -h <list of hosts> 'sudo portupgrade -pb --batch lang/ruby18'

But even something 'simple' like this:

Code:
# for i in `cat <list of hosts>` ; do ssh $i 'sudo portupgrade -pb --batch lang/ruby18

.. would be nice, if it would work.

The problem however is the fact that sometimes, but not always, somewhere along the line the process on the server seems to stop, and most of the time I'll see the program 'script' running at 100%. The ssh sessions must be terminated, and I have to login on the machine to complete the job.

My questions:

1) anyone know what's going on here?
2) am I doing something wrong, is there another way to do this?
 
We use portmaster as well, but still portupgrade most of the time. I agree that portmaster is much more elegant. But do you (wblock) think it's ruby related?

@SirDice: I was not referring to binary upgrades, although that is something I'm looking into (as well as pkgng).
 
frijsdijk said:
@SirDice: I was not referring to binary upgrades, although that is something I'm looking into (as well as pkgng).
If you do have 300 machines, why are you building stuff from ports on each machine? Why not set up a build server, build things once and distribute the resulting packages? Building things from ports 300 times isn't exactly efficient.
 
SirDice said:
If you do have 300 machines, why are you building stuff from ports on each machine? Why not set up a build server, build things once and distribute the resulting packages? Building things from ports 300 times isn't exactly efficient.

I said I was looking into that, didn't I?
 
I only suggested it isn't efficient to build the same port on 300 machines.
 
+1 for @SirDice's suggestion for a build server. This works for us.

On our cluster, I nfs mount /usr/local and /usr/compat on the compute nodes from a "software node". When I update a port on the "software node", the new version is available on all the compute nodes. This can break down if you're running, for example, 7.x on one some compute nodes and 9.0 on the "software" node.
 
SirDice said:
I only suggested it isn't efficient to build the same port on 300 machines.

SirDice: what about the fact that these 300 machines are not all the same version of FreeBSD, but 7.4, 8.1, 8.2, 8.3, and 9.0? (even some 32-bit, although 90% is 64-bit). And alot of machine have different compile options for apache/php etc.
 
frijsdijk said:
We use portmaster as well, but still portupgrade most of the time. I agree that portmaster is much more elegant. But do you (wblock) think it's ruby related?

Rebuilding the Ruby interpreter while a Ruby program is running could certainly cause problems. I remember some problems like that back when I was using portupgrade. There was enough of a problem that eventually I did not use portupgrade to upgrade portupgrade, Ruby, or databases/ruby-bdb, just manual port rebuilds.
 
wblock@ said:
Rebuilding the Ruby interpreter while a Ruby program is running could certainly cause problems. I remember some problems like that back when I was using portupgrade. There was enough of a problem that eventually I did not use portupgrade to upgrade portupgrade, Ruby, or databases/ruby-bdb, just manual port rebuilds.

Ah, but this was just an example with the portupgrade port. It happens with all sorts of ports.

Meanwhile, I'm looking into tinderbox. It seems pretty sweet!
 
Back
Top