[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: option to continue on exit status 255 (patch incl)
From: |
Scott Sinno |
Subject: |
Re: option to continue on exit status 255 (patch incl) |
Date: |
Mon, 11 Aug 2008 16:18:00 -0400 |
User-agent: |
Mutt/1.5.16 (2007-06-09) |
I neglected to actually attach the patch. Here it is.
On Mon, Aug 11, 2008 at 04:15:57PM -0400, Scott Sinno wrote:
>
> This is not a bug report, but rather a feature-request. Attached
> is a patch to implement the feature. More below..
>
> 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.
> address@hidden xargs]seq 5004 5006 | awk '{print "minion"$1}' | xargs -t -i
> ssh -q address@hidden "uname -a"
> ssh -q address@hidden 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 address@hidden uname -a
> xargs: ssh: exited with status 255; aborting
>
> #and now with the continue (-c) flag
> address@hidden xargs]seq 5004 5006 | awk '{print "minion"$1}' | ./xargs -c -t
> -i ssh -q address@hidden "uname -a"
> ssh -q address@hidden 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 address@hidden uname -a
> ssh: exited with status 255; continuing
> ssh -q address@hidden 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 address@hidden
> Systems Engineer Office : 301-614-5462
> "Bureaucracy is the epoxy that greases the wheels of progress." -Dr. Jim Boren
-----------------------------------------------------------------------------
Scott Sinno address@hidden
Systems Engineer Office : 301-614-5462
"Bureaucracy is the epoxy that greases the wheels of progress." -Dr. Jim Boren
xargs_continue.tar.gz
Description: GNU Zip compressed data