This is not a bug report, but rather a feature-request with
a patch attached to implement the feature. 

        I use xargs routinely to remotely execute commands via ssh on 
clusters with hundreds of machines.  Almost invariably, one or more
of the machines I want to issue a remote-command to is offline.  
Some subset of servers being offline is fairly normal in a large
data-center. 

        Of course, when even one machine is offline, attempting to 
run a remote command on it causes said-command to exit w/code 255,
in turn causing xargs to cease immediately.  The attached patch
allows the '-c' flag to be optionally included at execution.
If it is, xargs will continue on code 255 rather than halting.
While such behavior might make a rigorous developer recoil in 
horror, it has immense practical applications as it's simply unreasonable
to expect all the servers to be online at all times in a large computing
environment. 
        
        I am not a developer, nor do I even play one on TV.  It is
extremely likely that this patch does things the xargs maintainer(s)
won't like, for good reason.  I'm hoping someone more familar
with the xargs code will give this a good lookover, and perhaps
eventually incorporate this sort of functionality into the
findutils baseline. 

#trivial example, with and without '-c' flag provided by patch.
[EMAIL PROTECTED] xargs]seq 5004 5006 | awk '{print "minion"$1}' | xargs -t -i 
ssh -q [EMAIL PROTECTED] "uname -a"
ssh -q [EMAIL PROTECTED] uname -a 
Linux minion5004 2.6.8.1-26mdksmp #1 SMP Mon Nov 28 12:40:04 MST 2005 i686 
Intel(R) Xeon(TM) CPU 2.80GHz unknown GNU/Linux
ssh -q [EMAIL PROTECTED] uname -a 
xargs: ssh: exited with status 255; aborting

#and now with the continue (-c) flag
[EMAIL PROTECTED] xargs]seq 5004 5006 | awk '{print "minion"$1}' | ./xargs -c 
-t -i ssh -q [EMAIL PROTECTED] "uname -a"
ssh -q [EMAIL PROTECTED] uname -a 
Linux minion5004 2.6.8.1-26mdksmp #1 SMP Mon Nov 28 12:40:04 MST 2005 i686 
Intel(R) Xeon(TM) CPU 2.80GHz unknown GNU/Linux
ssh -q [EMAIL PROTECTED] uname -a 
ssh: exited with status 255; continuing
ssh -q [EMAIL PROTECTED] uname -a 
Linux minion5006 2.6.8.1-26mdksmp #1 SMP Mon Nov 28 12:40:04 MST 2005 i686 
Intel(R) Xeon(TM) CPU 2.40GHz unknown GNU/Linux

-----------------------------------------------------------------------------
Scott Sinno                             [EMAIL PROTECTED]
Systems Engineer                Office : 301-614-5462
"Bureaucracy is the epoxy that greases the wheels of progress." -Dr. Jim Boren

Attachment: xargs_continue.tar.gz
Description: GNU Zip compressed data

Reply via email to