[CUWiN-Dev] batch upgrades

Bill Comisky bcomisky at pobox.com
Thu Mar 24 10:30:39 CST 2005


shutdown -r sounds good to me.  You could pass through the whole 'time' 
argument (including + for time in minutes).  That way you could use a date 
format as well or 'now' for immediacy.

bill

On Wed, 23 Mar 2005, Bryan Cribbs wrote:

> I see, I didn't realize that.  If having a granularity
> of minutes rather than seconds is workable, then
> shutnow -r +$REBOOTMINS
> could be used, otherwise, I can revert back to the
> rebootin script, unless there are other ideas.
>
> * Bill Comisky <bcomisky at pobox.com> :
>> I saw that these scripts got added to the repository, cool.  The
>> cuw_rebootnodes script won't work as is though, with:
>>
>> ssh -n root@$1 "(sleep $REBOOTSECS; /sbin/reboot) &"
>>
>> I tried something like that originally, but the ssh session stays open for
>> REBOOTSECS instead of returning immediately.  I tried a few variations,
>> trying to redirect STDIN and STDOUT to /dev/null without success.  Using
>> the client side "rebootin" script was my inelegant fix.  Maybe someone
>> else knows how to fix it?
>>
>> bill
>>
>> On Tue, 15 Mar 2005, Bill Comisky wrote:
>>
>>> I've been using a few scripts to do batch upgrades of the testbed nodes in
>>> the lab at CNT, and thought I'd share them with the list. I actually just
>>> found localsrc/node-updater/*, but don't follow how it's meant to be used.
>>> If there's a better way than how I'm doing it, let me know.
>>>
>>> The method I use requires that root be able to ssh in to the node.  I'm
>>> using an authorized key file called 'root' in the AUTHORIZED_KEY directory
>>> to set this up password-less.  Buyer beware if you have security concerns.
>>> I made a slight change to /sbin/upgrade so that it reads the .tar.gz
>>> upgrade from STDIN if '-' is used as the upgrade file.  So then I can
>>> "push" an upgrade by:
>>>
>>> cat upgrade.tar.gz | ssh root at nodeIP 'export PATH="/sbin:/usr/sbin:$PATH";
>>> upgrade -'
>>>
>>> We've been using svk to mirror the CUWiN svn repository and version our
>>> local changes.  The attached patch I generated using 'svk diff' from the
>>> src/boot-image/ subdirectory.  The patch is against svn rev2884; the
>>> version numbers in the patch comments are our svk repository numbers.
>>>
>>> The patch includes changes to:
>>>
>>> etc-patches/patch-sshd_config
>>> extras/extraslog
>>> extras/sbin/upgrade
>>>
>>> and these new files:
>>>
>>> extras/sbin/getversions
>>> extras/sbin/rebootin
>>>
>>> Of course you have to setup your own ssh keys.  The last two files are
>>> helper scripts:
>>>
>>> getversions:
>>> Returns the current and next-boot CUWiN release version and device.
>>>
>>> rebootin:
>>> reboots the node after a given number of seconds.
>>>
>>> Also attached are the 3 server side wrappers scripts to cycle through node
>>> IPs and run these commands.  For example, on the machine hosting the
>>> upgrade tarball, the full cycle might look like:
>>>
>>> export NODES="10.0.146.86 10.0.244.159 10.0.244.144"
>>>
>>> # check current and next-boot CUWiN versions
>>> cuw_getversions $NODES
>>>
>>> # push upgrade
>>> cuw_pushupgrade upgrade.tar.gz $NODES
>>>
>>> # check again, should show upgrade on 2nd partition
>>> cuw_getversions $NODES
>>>
>>> #   reboot the nodes 60 seconds, this is just a serial loop
>>> #   so leave enough time for the script to ssh in to all the nodes
>>> #   on the command line
>>> cuw_rebootnodes 60 $NODES
>>>
>>> bill
>>>
>>> --
>>> Bill Comisky
>>> bcomisky at pobox.com
>>>
>>
>> --
>> Bill Comisky
>> bcomisky at pobox.com
>> _______________________________________________
>> CU-Wireless-Dev mailing list
>> CU-Wireless-Dev at lists.cuwireless.net
>> http://lists.chambana.net/cgi-bin/listinfo/cu-wireless-dev
> * Bill Comisky <bcomisky at pobox.com> :
>> I saw that these scripts got added to the repository, cool.  The
>> cuw_rebootnodes script won't work as is though, with:
>>
>> ssh -n root@$1 "(sleep $REBOOTSECS; /sbin/reboot) &"
>>
>> I tried something like that originally, but the ssh session stays open for
>> REBOOTSECS instead of returning immediately.  I tried a few variations,
>> trying to redirect STDIN and STDOUT to /dev/null without success.  Using
>> the client side "rebootin" script was my inelegant fix.  Maybe someone
>> else knows how to fix it?
>>
>> bill
>>
>> On Tue, 15 Mar 2005, Bill Comisky wrote:
>>
>>> I've been using a few scripts to do batch upgrades of the testbed nodes in
>>> the lab at CNT, and thought I'd share them with the list. I actually just
>>> found localsrc/node-updater/*, but don't follow how it's meant to be used.
>>> If there's a better way than how I'm doing it, let me know.
>>>
>>> The method I use requires that root be able to ssh in to the node.  I'm
>>> using an authorized key file called 'root' in the AUTHORIZED_KEY directory
>>> to set this up password-less.  Buyer beware if you have security concerns.
>>> I made a slight change to /sbin/upgrade so that it reads the .tar.gz
>>> upgrade from STDIN if '-' is used as the upgrade file.  So then I can
>>> "push" an upgrade by:
>>>
>>> cat upgrade.tar.gz | ssh root at nodeIP 'export PATH="/sbin:/usr/sbin:$PATH";
>>> upgrade -'
>>>
>>> We've been using svk to mirror the CUWiN svn repository and version our
>>> local changes.  The attached patch I generated using 'svk diff' from the
>>> src/boot-image/ subdirectory.  The patch is against svn rev2884; the
>>> version numbers in the patch comments are our svk repository numbers.
>>>
>>> The patch includes changes to:
>>>
>>> etc-patches/patch-sshd_config
>>> extras/extraslog
>>> extras/sbin/upgrade
>>>
>>> and these new files:
>>>
>>> extras/sbin/getversions
>>> extras/sbin/rebootin
>>>
>>> Of course you have to setup your own ssh keys.  The last two files are
>>> helper scripts:
>>>
>>> getversions:
>>> Returns the current and next-boot CUWiN release version and device.
>>>
>>> rebootin:
>>> reboots the node after a given number of seconds.
>>>
>>> Also attached are the 3 server side wrappers scripts to cycle through node
>>> IPs and run these commands.  For example, on the machine hosting the
>>> upgrade tarball, the full cycle might look like:
>>>
>>> export NODES="10.0.146.86 10.0.244.159 10.0.244.144"
>>>
>>> # check current and next-boot CUWiN versions
>>> cuw_getversions $NODES
>>>
>>> # push upgrade
>>> cuw_pushupgrade upgrade.tar.gz $NODES
>>>
>>> # check again, should show upgrade on 2nd partition
>>> cuw_getversions $NODES
>>>
>>> #   reboot the nodes 60 seconds, this is just a serial loop
>>> #   so leave enough time for the script to ssh in to all the nodes
>>> #   on the command line
>>> cuw_rebootnodes 60 $NODES
>>>
>>> bill
>>>
>>> --
>>> Bill Comisky
>>> bcomisky at pobox.com
>>>
>>
>> --
>> Bill Comisky
>> bcomisky at pobox.com
>> _______________________________________________
>> CU-Wireless-Dev mailing list
>> CU-Wireless-Dev at lists.cuwireless.net
>> http://lists.chambana.net/cgi-bin/listinfo/cu-wireless-dev
>

--
Bill Comisky
bcomisky at pobox.com


More information about the CU-Wireless-Dev mailing list