help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2.1.17 having issue with ExecResult() using pipelines


From: Mark Burgess
Subject: Re: 2.1.17 having issue with ExecResult() using pipelines
Date: Fri, 11 Nov 2005 08:33:36 +0100


Nathan,

binning cats is cruel so cfengine doesn't allow you to gloat with "yada
yada" afterwards. 

Actually this has to do with the fact that no shell is used to wrap the
command. It could be useful to have a functino which does wrap too. For
now you can do /bin/sh to hush up the cruelty.

Mark

On Thu, 2005-11-10 at 17:31 -0500, nathan r. hruby wrote:
> Hi!
> 
> I'm testing a cfengine 2.1.14 -> 2.1.17 upgrade this afternoon and have
> hit a snag.  It appears that the places in which I use constructs like
>    control:
>    fooish = ( ExecResult(/bin/sh -c "/bin/cat file | yada | yada | yada") )
> seem to be only executing the first argument (eg: the /bin/cat) instead of
> the whole pipeline.
> 
> For instance, a cfagent -d2 spins like this waiting for cat to return
> (which it never will):
> ----
> HandleFunctionObject(ExecResult(/bin/sh -c "/bin/cat /proc/loadavg | /bin/awk 
> '{print $1}' | tr -d '\n' "))
> IsBuiltinFunction(ExecResult(/bin/sh -c "/bin/cat /proc/loadavg | /bin/awk 
> '{print $1}' | tr -d '\n' "))
> IsBuiltinFunction: ExecResult(/bin/sh -c "/bin/cat /proc/loadavg | /bin/awk 
> '{print $1}' | tr -d '\n' ")
> HandleFunction: ExecResult(/bin/sh -c "/bin/cat /proc/loadavg | /bin/awk 
> '{print $1}' | tr -d '\n' ")
> FunctionStringToCode(ExecResult)
> Appending [/bin/sh -c /bin/cat /proc/loadavg | /bin/awk '{print $1}' | tr -d 
> '\n' ]
> ExpandVarstring(/bin/sh -c /bin/cat /proc/loadavg | /bin/awk '{print $1}' | 
> tr -d '\n' )
> ARG[0] /bin/sh -c /bin/cat /proc/loadavg | /bin/awk '{print $1}' | tr -d '\n' 
> cfpopen(/bin/sh -c /bin/cat /proc/loadavg | /bin/awk '{print $1}' | tr -d 
> '\n' )
> cfengine:: Time out
> ----
> 
> ps -ef during this spin shows that there's only a "/bin/cat" running.
> 
> I have several other variables that do similar constructs with find, and
> they appear to exhibit the same problem, returning the listing for the
> current working directory, instead of the directory I indicated in the
> second argument for find.
> 
> Did the way ExecResult works change recently, or is this possibly a bug
> related to the parameter changes in 2.1.16 (though the Changelog states it
> was fixed for 2.1.17a, which I'm not sure is what you get if you grab
> ftp://ftp.iu.hio.no/pub/cfengine/cfengine-2.1.17.tar.gz)
> 
> Thanks for any clues that could be landed upon my thick head :)
> 
> -n
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]