The Linux chkconfig utility is a command-line tool that allows you to specify in which runlevel to start a selected service, as well as to list all available services along with their current setting. Note that with the exception of listing, you must have superuser privileges to use this command.
Listing the Services
To display a list of system services (services from the/etc/rc.d/init.d/
directory, as well
as the services controlled by xinetd), either type chkconfig --list
, or use chkconfig
with no additional arguments.You will be presented with an output similar to the following:
|
Each line consists
of the name of the service followed by its status (on or off)
for each of the seven numbered runlevels.
For example, in the
listing above, NetworkManager is enabled in
runlevel 2, 3, 4, and 5, while abrtdruns in
runlevel 3 and 5.
The xinetd based services are listed at the end, being
either on, or off.
To display the current settings for a selected service only,
use
chkconfig --list
followed by the name of the service:
1
|
chkconfig
--list service_name
|
For example, to display the current settings for the
sshd
service, type:
1
2
|
~]# chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
|
You can also use this command to display the status of a service that is managed by xinetd.
In that case, the output will only contain the information
whether the service is enabled or disabled:
1
2
|
~]# chkconfig --list rsync
rsync off
|
No comments:
Post a Comment