2.6 Running cfengine permanently
Once you are happy using cfengine, you will want it to run least once
per hour on your systems. This is easily achieved by adding the following
line to the root crontab file of each system:
This is enough to ensure that cfengine will get run. Any output generated
by this job, will be stored in `/var/cfengine/outputs'.
In addition, if you add the following to the file `cfagent.conf',
the system administrator will be emailed a summary of any output:
0,30 * * * * /usr/local/sbin/cfexecd -F
smtpserver = ( mailhub.example.org ) # site MTA which can talk smtp
sysadm = ( email@example.com ) # mail address of sysadm
Fill in suitable values for these variables.
An alternative, or additional way to run cfengine, is to run the `cfexecd'
program is daemon mode (without the `-F') option. In this mode, the daemon
lives in the background and sleeps, activating only in accordance with
a scheduling policy. The default policy is to run once every hour (equivalent
Min00_05). Here is how you would modify `cfagent.conf' in
order to make the daemon execute cfagent every half-hour:
Note that the time specifications are the basic cfengine time classes,
See section 5.3 Building flexible time classes.
Although one of these methods should suffice,
no harm will arise from running both cron and the cfexecd side-by-side.
Cfagents locking mechanisms ensure that no contention will occur.
# When should cfexecd in daemon mode wake up the agent?
schedule = ( Min00_05 Min30_35 )
The other components of cfengine can be started by cfagent itself:
"cfenvd" restart "/usr/local/sbin/cfenvd"
"cfservd" restart "/usr/local/sbin/cfservd"