cfrun
The syntax of the cfrun
command is
cfrun -option --longoption class1 class2 ...
With the exception of the `-d' and `-S' options, all options are passed on to the remote hosts and are ignored locally. The `-q' option is always assumed when executing cfengine remotely, so that SplayTime is effectively zero when polling hosts serially. If an option includes a name such as `-Dnewclass', there should not be a space between the option letter and the name string. The remaining options are treated as classes to be sent to all the hosts on the network.
Each host evaluates the classes sent by cfrun
and decides whether cfengine should be invoked.
Only hosts which belong to the classes defined on the cfrun
command line are executed. This allows you to single out groups of hosts
which should execute cfengine, based on the very classes which you have
defined for your configuration. If no classes are sent on the command
line, then all hosts are run.
cfrun
uses a configuration file which is located under the
CFINPUTS
directory in order to determine which hosts and in
which order it should try to connect. Because cfengine always uses a
reliable TCP protocol for connections, it verifies each connection
rather than simply broadcasting openly. Using this file you can even
simulate broadcasting to hosts outside your subnet.
This file should contain every host name you ever want to
configure remotely, because you can still select subsets of
the file by specifying classes which the remote host will understand.
If the remote host is not in one of the classes you specify when you
run cfrun
, then it will simply ignore the request. Conversely,
if you do not place a host in this file, it will never be contacted
when you use the cfrun
command. The format of the file
is as follows
# # Comment .. # domain=my.domain hostname1 options hostname2 options ...
It is important to add the domain-name to this file. The options you specifiy in this file, per host, are added to those you might specify on the command line when invoking cfengine remotely. For instance, you might know of a bug on one host and decide not to perform interface configuration on that one machine. You would write a line like this:
funny.domain -i # problem host
You could use cfrun
inside one of your cfengine configuration
files in order to remotely execute cfengine on all of the other
network machines, by setting up a host list. Be careful not to
include the name of the master host in the list. The locks should
prevent cfengine from being run on the masterhost, avoiding an
infinite loop. This way you do not have to rely on cron running
on every system. The disadvantage however is that cfengine
has to poll the systems on the network, which means that cfengine
cannot be working in parallel on all hosts. This could be
inefficient in the long run.
Go to the first, previous, next, last section, table of contents.