Chapter 18. System Initialization

Table of Contents
Cron Jobs
Run Levels
Init Script Actions
Comment conventions for init scripts
Installation and removal of init.d files
Facility names
Script names
Init script Functions

Cron Jobs

Packages may not touch the configuration file /etc/crontab, nor may they modify the files in /var/spool/cron/crontabs.

If a package wants to install a job that has to be executed via cron, it shall place a file with the name if the package in one of the following directories:

/etc/cron.daily
/etc/cron.weekly
/etc/cron.monthly

As these directory names say, the files within them are executed on a daily, weekly, or monthly basis, respectively.

If a certain job has to be executed more frequently than daily, the package shall install a file /etc/cron.d/<package-name> tagged as configuration file. This file uses the same syntax as /etc/crontab and is processed by cron automatically.

It is recommended that files installed in any of these directories be scripts (shell scripts, Perl scripts, etc.) so that they may be modified by the local system administrator. In addition, they must be registered as configuration file.

The scripts in these directories have to check, if all necessary programs are installed before they try to execute them. Otherwise, problems will arise when a package was removed (but not purged), since the configuration files are kept on the system in this situation.