The best way to kill a daemon is to use the kill_daemon command followed
by the name of the daemon. For example:
kill_daemoncopydThis command guaranties that the daemon will die gracefully. First the .status file in the daemon's working directory is checked. If the status is not IDLE, then the daemon is not killed and the operator has to retry the command later. Otherwise, a Unix kill command is issued against the pid found in the .pid file. Then the list of the current processes is checked to see if the process is really dead. Eventually, the daemon's .status file is removed so that the daemon may be normally restarted later.
The best way to take the whole pipeline down (that is to kill all the archive
daemons) is to use the kill_archive command (no argument).
This command simply invokes the previous kill_daemon command for
each of the daemons making up the pipeline. A mail message is then sent
to the archive managers to warn of the attempt to stop the pipeline,
with a diagnostic message (success or failure) and a copy of the standard
output of the command. Like the kill_daemon command, the
kill_archive command may have to be issued several times before
all the daemons can be killed.
The best way to start a daemon is to use the start_daemon command followed by the name of the daemon. For example:
start_daemoncopydThis command guaranties that the daemon will be started only if it previously died gracefully, namely by checking that there is no .status file in the daemon's working directory. However, even if a .status file is found, the daemon may be safely restarted if both the following conditions are met:
N.B.: The archive manager can force any daemon to be restarted only by removing the .status file in the daemon's working directory. However this is risky business and before doing this chapter 6 should be consulted.
The best way to start the whole pipeline (that is to start all the archive
daemons) is to use the start_archive command (no argument).
This command simply invokes the previous start_daemon command for
each of the daemons making up the pipeline. A mail message is then sent
to the archive managers to warn of the attempt to start the pipeline,
with a diagnostic message (success or failure) and a copy of the standard
output of the command.
An invocation to the start_archive command has been added to the /etc/rc.special file to allow an automatic restart of the archive pipeline at the end of the booting process (/etc/rc.special is executed as root so a set-uid to archive is performed before running start_archive). This feature can be handy in case of an incident (like a power failure) that forced the archive machine to reboot. Then when the machine comes back up, each archive daemon are automatically restarted provided it was idle when the incident occured (which, as we mentionned earlier, is rather likely). The mail message sent by the start_archive command will immediatly warn the archive manager that an incident occured.
NB: Before shutting down the archive machine, make sure to shut down the archive pipeline properly so as it can be restarted automatically at the end of the reboot process.