Programs that require a daemon to be started have an initialization script in the /etc/rc.d/init.d/ directory. This script can also be used to run a command at boot time such as the readahead_early and readahead_later scripts, which run the readahead utility which loads the programs used at startup into memory before they are needed. It decreases the amount of time it takes to start the system. While booting a Red Hat Enterprise Linux system, the init program is run last in the kernel boot process. This program first executes the /etc/rc.d/rc.sysinit script to perform actions such as loading kernel modules for hardware support, loading the default keymap, and setting the hostname. The /etc/inittab script is run next, which then tells init which runlevel to start. The runlevel defines which services to start at boot time, or which initialization scripts to execute.
Lastly, the /etc/rc.d/rc.local script is executed. Commands can be added to this file for custom initialization. The initialization scripts enables user to start, stop, and restart services after the system has booted. These actions are performed with the service command as the root user. Each script has its own list of actions. Common actions defined include start, stop, conrestart (which stops and starts the service only if it is already running), and status.
To perform an action, use the following syntax:
service
For example, the following starts the OpenSSH service:
Post a Comment