Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
79
/etc/rcN.d/ directories. With this arrangement, now it is possible to have centralized commands
such as chkconfig and /sbin/services manage all services from a single interface.
RHEL Service Management
In RHEL, the /sbin/service utility provides a consistent interface for executing the init
scripts. The init scripts provide a consistent interface for managing a service by providing options to
start, stop, restart, query status, and reload and to perfrom other actions on services. Since nearly all
services on a server need high privileges, you need to log in as root to control them.
You can view the current state of all services with the -status-all option of the service utility:
#/sbin/service status-all
abrtd (pid 1762) is running...
acpid (pid 1477) is running...
atd (pid 1817) is running...
The run-level information for these services (that is, the system run level at which the service will be
started) can be queried and modified with the chkconfig utility.
For example, to see the current settings for the crond service, execute the following command:
#/sbin/chkconfig --list crond
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
This shows that the crond service will be automatically started at boot time for run-levels 2, 3, 4, and
5.
To set the service to not start for run levels 3 and 4, you can use the chkconfig utility as shown
below:
#/sbin/chkconfig --level 34 crond off
To disable a specific daemon, you need to execute the command shown below:
#/sbin/chkconfig daemon-name off
Replace daemon-name with the name of the service you wish to disable.
Managing and Controlling Service Dependencies
RHEL has all service control scripts in /etc/init.d/, and then the run level at which each of
these services is started is controlled using symbolic links to these scripts in the various
/etc/rcN.d/ directories.
Let’s look at what happens when we enable crond only in run level 5.
We run the following command to accomplish this: