Chapter 8. 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

In addition to the individual user crontab files specified by ISO POSIX (2003) stored under /var/spool/cron, the process that executes scheduled commands shall also process the following additional crontab files: /etc/crontab, /etc/cron.d/* The installation of a package shall not modify the configuration file /etc/crontab.

If a package wishes to install a job that has to be executed periodically, it shall place a file in one of the following directories:

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

As these directory names suggest, the files within them are executed on a daily, weekly, or monthly basis, respectively, under the control of an entry in one of the system crontab files. See below for the rules concerning the names of files in these directories.

It is recommended that files installed in any of these directories be scripts (e.g. shell scripts, Perl scripts, etc.) so that they may be modified by the local system administrator.

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

If a certain job has to be executed at a different frequency (e.g. more frequently than daily), the package shall install a file /etc/cron.d/cron-name tagged as a configuration file. This file uses the same syntax as /etc/crontab and is processed by the system automatically.

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 shall come from a managed namespace. These filenames may be assigned using one of the following methods: