Node: Invoking cfengine, Neste: CFINPUTS environment variable, Forrige: Options, Opp: Getting started
Cfengine may be invoked in a number of ways. Here are some examples:
host% cfengine host% cfengine --file myfile host% cfengine -f myfile -v -n host% cfengine --help |
The first of these (the default command, with no arguments) causes
cfengine to look for a file called cfengine.conf
in the current
directory and execute it silently. The second command reads the file
myfile
and works silently. The third works in verbose mode and
the -n
option means that no actions should actually be carried
out, only warnings should be printed. The final example causes cfengine
to print out a list of its command line options.
The complete list of options is listed in the summary at the beginning
of this manual, or you can see it by giving the -h
option,
(see the reference manual).
In addition to running cfengine with a filename, you can also treat cfengine files as scripts by starting your cfengine program with the standard shell line:
#!/local/gnu/bin/cfengine -f # # My config script #
Here we assume that you have installed cfengine under the directory
/local/gnu/bin
. By adding a header like this to the first line
of your program and making the file executable with the chmod
shell command, you can execute the program just by typing its
name--i.e. without mentioning cfengine explicitly at all.
As a novice to cfengine, it is advisable to check all programs with the
-n
option before trusting them to your system, at least until you
are familiar with the behaviour of cfengine. This `safe' option allows
you to see what cfengine wants to do, without actually committing
yourself to doing it.