2.7 cfengine Troubleshooting

The following are some troubleshooting hints for working with cfengine.

1.Run cfservd on the master server using the --no-fork (-F) and the --verbose (-v) options. This will provide useful information for any troubleshooting efforts.

2.You may see authentication errors. When performing a "cfagent -K"operation, the following messages are displayed:

cfengine:: BAD: key could not be accepted on trust

cfengine:: Authentication dialogue with master-server. abc.xyz.com failed cfengine:client:/var/opt/dsau/cfengine/inputs/update.conf:194: Warning: actionsequence is empty cfengine:client:/var/opt/dsau/cfengine/inputs/update.conf:194: Warning: perhaps cfagent.conf/update.conf have not yet been set up?

This problem is most likely due to the cfengine security setup. To resolve the problem, you will need to exchange cfengine public keys between the managed client and master server. The csync_wizard (see csync_wizard(8)) automates this process when adding clients. See the section “Configuring a Synchronization Managed Client” (page 35) for instructions on manually distributing keys to managed clients.

3.“Warning: actionsequence is empty” errors

Use the cfagent -v option to get more information. One possible cause of this message is that update.conf has not been added to the client’s /var/opt/dsau/cfengine/ inputs directory.

4.Syntax error due to missing or superfluous spaces

#cfagent -K

cfengine::/var/opt/dsau/cfengine/inputs/update.conf:39: syntax error cfengine::/var/opt/dsau/cfengine/inputs/update.conf:

Execution terminated after parsing due to errors in program

In the first line of the example above, cfengine is reporting a syntax error on line 39 of the file update.conf. The error reported may be caused by a space in line 38, the previous line in the file update.conf.

Check for extra spaces in the configuration files. As a general rule, using spaces can improve readability. One common problem is missing spaces within parentheses. For example, a function should have no space between the function name and its leading parenthesis but the function itself requires leading and trailing spaces within its enclosing parentheses. For example, the following snippet shows the use of required leading and trailing spaces for the function ExecResult.

control:

my_variable = ( ExecResult(/bin/ls -l) )

5.Unable to connect to a cfengine client or master.

# cfrun

 

 

 

 

cfrun(0): ..........

[

Hailing

host1

] ..........

cfrun(0): ..........

[

Hailing

host2

] ..........

cfrun:host2: Couldn’t open a socket

cfrun:host2: socket: Connection refused

Check that the cfservd daemon on host2 is configured and running.

Use /sbin/init.d/cfservd start to start cfservd if it is not running.

6.“Can’t stat” messages

When running using either cfrun or cfagent, you might get “can’t stat” errors. For example,

host1: Can’t stat

/var/opt/dsau/cfengine_master/master_files/etc/test in copy

2.7 cfengine Troubleshooting

39