[GE users] Restarting sge_execd on all nodes

paulu pcu-m at xs4all.nl
Tue Mar 3 22:33:02 GMT 2009


On Tuesday 03 March 2009, fx wrote:
> paulu <pcu-m at xs4all.nl> writes:
> > Of course I could do some scripting, using 'qselect -qs u' to
> > iterate over all unavailable nodes, but perhaps there is a more
> > elegant way.
>
> You have to remote-shell in some way.  If you have pdsh, this works
> (possibly modulo shell maximum line length with lots of nodes):
>
>   pdsh -w $(qselect-node-list -qs u) /etc/init.d/sgeexecd start
>
> with
>
>   $  cat `which qselect-node-list`
>   #!/bin/sh
>   # Run `qselect "$@"' and produce pdsh-compatible host list
>   qselect "$@" |
>     sed -e 's/^[^@]*@//' -e 's/\..*//' |  # host short names
>     sort | uniq |                         # unique list
>     tr '\n' ,                             # comma-separated
> (trailing comma OK)


Thanks, that looks quite simple and elegant. I did not know pdsh yet.

As a small side note (not meant as critisism), I would write the 
qselect-node-list script slightly shorter:

 #!/bin/sh
 # Run `qselect "$@"' and produce pdsh-compatible host list
 qselect "$@" |
   sed 's/^[^@]*@//;s/\..*//' | # host short names
   sort -u |                    # unique list
   tr '\n' ,                    # comma-separated (trailing comma OK)

So whithout the -e option of sed (you can just concatenate sed 
commands, separated by a semicolon). And sort|uniq can be replaced by 
sort -u.

Thanks again for suggestion pdsh. Yet another nice tool in the 
toolbox!

Paul.

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=119882

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list