Next Previous Contents

6. Auxiliary commands.

Some system files require special configuration operations beyond the simple installation of system files. For example, after updating the printcap file one should restart the lpd daemon. Another special case is the crontab configuration: there is no crontab file as such, the current configuration is obtained by executing the command crontab -l. The output of the command must thus be stored into a temporary file to perform the sysf operations.

To achieve this, it is possible to force sysf to execute an auxiliary command. The commands are named after their entry name and the executable file, usually a script file, must be in the BIN sub-directory of the config directory. The auxiliary command is executed only if a special flag is set in the sysf.conf file.

The auxiliary commands make it possible for administrators to force sysf to execute some customised configuration commands. They can write their own auxiliary commands and get them to do anything that is required. The auxiliary command is always called with 5 arguments:

    AUX_COM ACTION COM SYSTEM_FILE CONFIG_FILE ECHO_ON

The sysf flags listed in the sysf.conf govern when the auxiliary command is executed by sysf and which argument are passed to the command.

For directory lists the auxiliary commands are handled in a special way to act on every modified entry of the directory. This is described in the directory list section.

The arguments passed to the auxiliary command correspond to the following:

Argument 0 : AUX_COM

The full path of the auxiliary command. The entry name can be extracted from this argument as the last name of the path (using $0:t under the csh shell).

Argument 1 : ACTION

The first argument corresponds to the action to be performed. The valid names are listed below and the letter between brackets is the flag that must be set in the sysf.conf file for the auxiliary command to be executed.

Argument 2 : COM

The sysf command name. This can be tested to tailor some operations for some sysf commands. For example the -CreateSysFile can be used to display extra information (like the existence of some symbolic links in /etc/rc.d/rcN.d) when the info command is executed. The command name is the full name of the sysf command that is executed (install, archive, new ...) Short cuts are converted to the full name.

Argument 3 : SYSTEM_FILE

The full path name of the system file. When the system file does not really exist (like the crontab file) this is the file that must be created so that sysf can compare the config file and the system file.

Argument 4 : CONFIG_FILE

The full path name for the config file including the suffix. This can be used to create the system file (as for the crontab file).

Argument 5 : ECHO_ON

This is set to either "on" or "off" to specify if echo is on or not. One should check this and display some information about what is being done when echo is on.

Some examples of auxiliary command files are given in the case studies section below.


Next Previous Contents