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.
C : the auxiliary command is called with the ACTION set
to -CreateSysFile before the sysf command is executed.
The auxiliary command is also
called with the ACTION set to -UpdateSysFile after any
sysf installation command (install, first_install and
OS_install). This is typically used to create non existing
system file like the crontab entry. I : the auxiliary command is called with the ACTION set
to -PreInstall before any sysf installation command.
the auxiliary command is also called with the ACTION set
to -PostInstall after any sysf installation command.
This is typically used to start or stop services (rc.d entries) or
restart some daemon after a system file has changed (lpd for
printcap). 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.
-CreateSysFile (C) : used before the sysf command is
performed, this will normally create a temporary system file with the
name
given by the 3rd argument: SYSTEM_FILE. For instance, the command for
the crontab file will be something like
"crontab -l >! $SYSTEM_FILE".
-UpdateSysFile (C) : this command is called after
install, first_install or OS_install to update the system file. For example, the command for the crontab file will be something like
"crontab $SYSTEM_FILE".
-PreInstall (I) : this command is called just before the
install, first_install or OS_install command is executed.
This can be used to prepare the way before an installation is performed or
to create a backup of the system file.
-PostInstall (I) : this command is called just after the
install, first-install or OS_install command is executed.
This is typically used to complete the installation process like restarting
a daemon, updating the NIS database on the NIS master server ...
-Remove : this is called only when the uninstall
command is executed. This is actually the only thing that uninstall
does. A typical example is to remove the symbolic link in
/etc/rc.d/rcN.d (where N is usually 3) to disable a start up
script file. The same symbolic link would normally be created either
with -PostInstall or the -UpdateSysFile ACTION.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.