help-cfengine@gnu.org
[Top] [All Lists]

Re: run cfengine with params

Subject: Re: run cfengine with params
From: Will Lowe
Date: Thu, 11 Nov 2004 11:39:11 -0800
I do this with environment variables.  The cron job that runs cfengine
looks like this:

30 * * * *     root  RUNNING_FROM_CRON=YES /usr/sbin/cfexecd -F

And then in the configs I have:

groups:

    splay      = ( IsDefined(RUNNING_FROM_CRON) )

control:
    splay::
        SplayTime = ( 55 )


... so when it's run by hand, RUNNING_FROM_CRON is unset, the "splay"
class isn't defined, and no splaying happens.

On Tue, Nov 09, 2004 at 01:43:39PM -0500, Dave Stern wrote:
> We would like cfengine to run in two different formats yet use the same 
> config file. Is this possible?
> 
> Specifically, I'd like an interactive script to use a different value 
> for SplayTime which is defined in control in the config file.
> 
> Ideally, I'd like a command line parameter like:
> cfengine -f ... -DsPlayTime=1
>    for interactive   and
> cfengine -f ... -Dsplaytime=60
>    for cron
> 
> But if this can only be done by defining a class from the command line 
> and having some class stanza that changes splaytime, that would be ok 
> too (just work coding to set). If so, could someone show an example?
> 
> TIA
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@xxxxxxx
> http://lists.gnu.org/mailman/listinfo/help-cfengine

-- 
                                        thanks,
                
                                        Will


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

<Prev in Thread] Current Thread [Next in Thread>