chkconfig command in Linux using practical Examples

Linux

The chkconfig command is a Linux utility used to enable and disable services on Linux systems. It is part of the System V init system, which is used to manage system services at boot time. By using chkconfig, you can control which services are started at boot time and which services are stopped. 

Here at Fixwebnode, we shall look into the basics of the chkconfig command, its options and usage, and provide some practical examples.

 

What is the chkconfig Command?

The chkconfig command is a Linux utility used to enable and disable system services. It is part of the System V init system, which is used to manage system services at boot time. By using chkconfig, you can control which services are started at boot time and which services are stopped.

The chkconfig command is available on most Linux distributions, including Red Hat, Fedora, CentOS, and Ubuntu.

 

chkconfig Command Options and Usage

The chkconfig command has several options which can be used to control the behavior of the command. 

The most commonly used options are listed below:

  • --add: adds a system service to the list of services that can be started and stopped.
  • --del: deletes a system service from the list of services that can be started and stopped.
  • --list: lists all services and their status (enabled or disabled).
  • --level: sets the runlevel for a service.
  • --off: disables a service.
  • --on: enables a service.

 

To use the chkconfig command, you must specify the service you want to enable or disable and the runlevel in which you want the service to be enabled or disabled. 

 

Examples of using chkconfig Command

Let's look at some examples of how to use the chkconfig command.

 

1. To list all services on the system and their status, you can use the --list option:

$ chkconfig --list

 

2. To enable a service in runlevel 3, you can use the --on option:

$ chkconfig --level 3 --on <service_name>

 

3. To disable a service in runlevel 5, you can use the --off option:

$ chkconfig --level 5 --off <service_name>

 

[Need help in fixing Linux System issues ? We can help you. ]

 


Conclusion

This article covers how to use chkconfig command in Linux. In fact, The chkconfig command can be used to enable and disable services on Linux systems, and is available on most Linux distributions.

Your Cart