Identifying Services that Start at Each Runlevel
There are number of ways to identify which services get started without having to delve into the /etc/rc.d sub-directories. The command line tool chkconfig (usually located in the /sbin directory) can be used to list which services get started at boot time. To list all service settings run the following command:
/sbin/chkconfig --list
This will display a long list of services showing whether or not they are started up at various runlevels. You may want to narrow the search down using the grep tool. For example to list the entry for the sshd daemon, execute the following command:
/sbin/chkconfig --list | grep sshd
When run, the above command should result in something output similar to the following:
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
The above output indicates that the sshd service is started automatically at runlevels 2, 3, 4, and 5. Alternatively you may just be interested to know which services get started for runlevel 3:
/sbin/chkconfig --list | grep '3:on'
Changing the Services for a Runlevel
In addition to listing services, chkconfig can also be used to change the settings for a particular runlevel. If, for example, we wanted the httpd service to start up at runlevel 5 we would issue the following command:
/sbin/chkconfig --level 5 httpd on
A number of graphical tools are also available for administering services. On RHEL you can select the System -> Administration -> Services or System -> Administration -> Server Settings -> Services menu option or run the following command:
system-config-services
This graphical tool allows you to view which services will start for each runlevel, add or remove services for each runlevel and also manually start or stop services:
You are reading a sample chapter from the RHEL 6 Edition book.
|
Tidak ada komentar:
Posting Komentar