chkconfig command in Red Hat and it perimeters

chkconfig command in Red Hat and it perimeters

chkconfig command in Red Hat and it perimeters

The chkconfig command in Red Hat-based Linux distributions is used to manage the runlevel configuration of services, allowing you to specify which services should start or stop automatically at different runlevels. However, please note that with the transition to systemd, the chkconfig command is becoming less common, as systemd provides a more advanced way of managing services and their behavior. Table with information and examples related to the chkconfig command:

CommandDescriptionExample
chkconfig --listList all available services and their current runlevel settingschkconfig --list
chkconfig --add Add a service to the system’s list of managed serviceschkconfig --add apache2
chkconfig --del Remove a service from the list of managed serviceschkconfig --del apache2
chkconfig --level Configure a service to start or stop at a specific runlevelchkconfig --level 3 apache2 on
chkconfig onConfigure a service to start at default runlevelschkconfig apache2 on
chkconfig offConfigure a service to stop at all runlevelschkconfig apache2 off

Examples:

  1. List all available services and their current runlevel settings:
Bash
   chkconfig --list
  1. Add a service to the list of managed services:
Bash
   chkconfig --add apache2
  1. Remove a service from the list of managed services:
Bash
   chkconfig --del apache2
  1. Configure a service to start at a specific runlevel (e.g., runlevel 3):
Bash
   chkconfig --level 3 apache2 on
  1. Configure a service to start at default runlevels:
Bash
   chkconfig apache2 on
  1. Configure a service to stop at all runlevels:
Bash
   chkconfig apache2 off

Remember that modern Linux distributions, especially those using systemd, have shifted toward using systemctl for managing services. While chkconfig may still be available on some systems, it’s recommended to familiarize yourself with systemctl for a more comprehensive and modern approach to service management.

Exit mobile version