Chapter 22. System Initialization

Table of Contents
Cron Jobs
Init Script Actions
Comment conventions for init scripts
Installation and removal of init.d files
Run Levels
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 of 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.

To avoid namespace conflicts in the /etc/cron.* directories, the filenames used by LSB-compliant packages in /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly, or /etc/cron.d must come from a managed namespace. These filenames may be assigned using one of the following methods: