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: Martin, Jason H
Subject: RE: 2.1.17 having issue with ExecResult() using pipelines
Date: Fri, 11 Nov 2005 09:28:29 -0800

Have you tried running all of that under strace / truss and see what
gets executed?

-Jason Martin

> -----Original Message-----
> From: nathan r. hruby [mailto:address@hidden 
> Sent: Friday, November 11, 2005 9:22 AM
> To: Martin, Jason H
> Cc: Brendan Strejcek; Mark Burgess; address@hidden
> Subject: RE: 2.1.17 having issue with ExecResult() using pipelines
> 
> 
> 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:address@hidden
> >> Sent: Friday, November 11, 2005 8:47 AM
> >> To: Martin, Jason H
> >> Cc: Mark Burgess; address@hidden
> >> 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
> > address@hidden 
> > http://lists.gnu.org/mailman/listinfo/help-cfengine
> >
> 
> -- 
> -------------------------------------------
> nathan hruby <address@hidden>
> uga enterprise information technology services
> production systems support
> -------------------------------------------
> 




reply via email to

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