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: nathan r. hruby
Subject: RE: 2.1.17 having issue with ExecResult() using pipelines
Date: Fri, 11 Nov 2005 12:21:51 -0500 (EST)

On Fri, 11 Nov 2005, Martin, Jason H wrote:

If yada isn't in the normal path then that might be a problem; I don't
know what PATH will be set to when that happens. Good point.


Err.. right: here's the full real command:
        CurrentLoad = ( ExecResult(/bin/sh -c "/bin/cat /proc/loadavg | /bin/awk 
'{print $1}' | tr -d '\n'") )

What I'm seeing in 2.1.17 is that everything after "/bin/cat" simply
dissapears and thus no pipeline.  eg, run a ps -ef while this is runnning
and the awk and tr are not being executed.  The above works in 2.1.14.

I also have several ExecResult() calls that use find and they too exhibit
the same behavior:
        MailQueueCount       = ( ExecResult(/bin/sh -c "/usr/bin/find 
/var/spool/mqueue -type f -name 'q*' | wc -l | tr -d ' ' | tr -d '\n' ") )
returns a find for $CWD, not /var/spool/mqueue, and certianly not the
output of "wc -l"

Thanks,

-n

-Jason Martin

-----Original Message-----
From: Brendan Strejcek [mailto:brendan@cs.uchicago.edu]
Sent: Friday, November 11, 2005 8:47 AM
To: Martin, Jason H
Cc: Mark Burgess; help-cfengine@gnu.org
Subject: Re: 2.1.17 having issue with ExecResult() using pipelines


Martin, Jason H wrote:

CFE only checks that the first command in ExecResult is
fully pathed.

Yeah, but what if the environment passed to the shell does
not contain a PATH? Maybe the *shell* can't find the program.
Just a thought...

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science
http://www.cs.uchicago.edu/people/brendan



_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine


--
-------------------------------------------
nathan hruby <nhruby@uga.edu>
uga enterprise information technology services
production systems support
-------------------------------------------




reply via email to

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