Cfengine configuration directory

Defining classes as a result of actions

Relevant classes: any

Cfengine can define classes based on the outcome of certain operations using the
define=class1,class2..  elsedefine=class3,class4..
option tags. These tags are complementary. The elsedefine tag is only available in versions later than 1.5.4. The criteria for defining classes with the first option are described in the list below.
disk/required
If freespace= is set, the define= is defines if the actual amount of free space is less than the value specified in freespace= and elsedefine= is defined if the value is within those bounds.

If freespace= is not set, then define= becomes active if the filesystem checks out, according to the criteria for required filesystems (see reference manual).

disable
The define= classes are defined if a file was disabled, emptied or rotated, otherwise elsedefine= is defined.
editfiles
define= becomes active if the number of changes to a file is greater than zero, else elsedefine= is defined.
files
If a file operation results in action being taken to fix or compress a file, the classes are defined. If the file permissions are correct and no action is taken, then elsedefine= is defined.
shellcommands
define= is defined if the exit status of the command (return code) is zero, else elsedefine= is defined.
copy
define= is defined if a file is not up to date (i.e. update is attempted). elsedefine= is defined if the file is up to date.
link
define= becomes active if a link is actually updated or tidied (for stale links), while elsedefine= is set if the link is okay.
Back to documentation