help-cfengine
[Top][All Lists]
Advanced

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

Re: How to run cfengine?


From: Chris Edillon
Subject: Re: How to run cfengine?
Date: Wed, 19 Sep 2001 21:36:28 -0400 (GMT+4)

On 19 Sep 2001, Shannon Lee wrote:
> On Tue, 2001-09-18 at 19:43, MASAMARA@aol.com wrote:

> > Hi,
> >      I know that my question might be very stupid, but I will appreciate 
> > your 
> > answer. I have installed cfeingine package on my linux box, and I have no 
> > clue that how would I start the cfengine e.g; deamons, etc. 
> >      I am not even sure, how to tell that cfengine is installed fine. I 
> > didn't receive any error message during the installation of the package.
> >      Thank you in anticipation for all your help.

> think of it like a shell; you can run it with cfengine -f 'commands
> file' (or, it automatically looks for 'cfengine.conf' in the current
> working directory), or you can create a cfengine script by sticking a 
> #!/path/to/cfengine at the top.
> 
> the latter is how i do it, makes it easy to run a single command from
> wherever.  
> 
> i would like to know how come it looks for 'cfengine.conf' in the
> current dir, rather than somewhere nice and standard, like /etc. 
> 
  don't know why the design decision was made, but probably for
the flexibility.  as it is now, you can give cfengine the -f flag
to specify a file to use, or even to use it as a standalone script
as you do.  however, you can also set the CFINPUTS variable to some
directory (such as /etc/cfengine or /usr/local/etc/cfengine), and
cfengine will look in this directory for all of its cfengine scripts
by default.  so, if you run:

% setenv CFINPUTS /etc/cfengine
% cfengine

it will look for cfengine.conf in the /etc/cfengine directory.  you
can also do:

% setenv CFINPUTS /etc/cfengine
% cfengine -f cf.myscript

and it will look for cf.myscript in /etc/cfengine  if CFINPUTS is
set, however, files in the current working directory will be ignored.
  CFINPUTS is most handy in a cfengine startup script.  you can use
a homebrewed script which sets CFINPUTS before executing cfengine,
and run this out of cron periodically.  there is also a perl script
called cfwrap which comes with the source code (in the bin/ directory)
which can also be used for this purpose, although you'll probably
want to tweak it a bit (for example it assumes that cfengine is in
/usr/local/sbin, and CFINPUTS is set to /usr/local/lib/cfengine/inputs).
when using cfengine to keep a machine or set of machines at a known
configuration state, you'll probably want to run it out of cron
regularly (say every half-hour or hour).
  you can even bypass cron altogether and use cfd to execute your
cfengine wrapper script by setting AutoExecCommand and AutoExecInterval
in cfd.conf (and making sure cfd is started at boot time).  for use on
a single machine, however, this is probably overkill since you wouldn't
be using any of cfd's primary features, like remote copies and remote
execution of cfengine.

chris




reply via email to

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