help-cfengine
[Top][All Lists]
Advanced

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

Re: shellcommands returns 256, not 0


From: Chris Edillon
Subject: Re: shellcommands returns 256, not 0
Date: Mon, 19 Apr 2004 21:03:08 -0400 (GMT+4)

On Mon, 19 Apr 2004, Brendan Strejcek wrote:

> classes/groups is not a normal action (it should not appear in your
> actionsequence). I happens before everything else (I forget why, but I
> think there is a good reason). When the classes are evaluated, it has
> not yet looked at the control section.
> 
> If you want a slightly more elegant style than shellcommands with &&, you
> can do something like the following:
> 
>     shellcommands:
> 
>         any::
> 
>             "${test} -d ${dir}" define=is_dir
> 
>         is_dir::
> 
>             "/something/to/do/if/is/dir"
> 
> That is rather readable and seems to fit the cfengine paradigm while
> preserving your order.
> 
> The problem with this is that you see lots of shellcommands in inform
> mode which can obfuscate what is actually going on.
> 
> Maybe you can do something with the files action and a define.

  how about the old standby:

classes:
    have_etc = ("/usr/bin/test -d /etc")

that's always the way i've set classes based on simple tests.
anything more complicated can be done with modules but the
above should be fine.  see the "shellcommands classes" section
of the cfengine tutorial.

chris





reply via email to

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