• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

chkconfig Command Examples in Linux

by admin

The chkconfig command can be used to control services at each runlevel. It can also be used to start or stop services during system startup.

Syntax

The syntax of the chkconfig command is:

# chkconfig [options] [service] [subcommand]

The following are some subcommands and options that can be used with chkconfig to control services.

Option Used To
{service} on Enable a service to be started on boot.
{service} off Disable a service so that it is no longer started on boot.
{service} reset Reset the status of a service.
–level {runlevel} Specify the runlevel in which to enable or disable a service.

chkconfig Command Examples

1. To see the current runlevel states for all the services:

# chkconfig --list 

2. To list a particular service status:

# chkconfig --list nfs 

3. To add a service script into the runlevel:

# chkconfig --add /etc/init.d/myservice.sh 

4. To delete a service script from the runlevels:

# chkconfig --del /etc/init.d/myservice.sh 

5. To specify the runlevel for any service, which should pertain to it:

# chkconfig --level

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6,7 : How to recover an interrupted yum package installation
  2. Complete Guide to Configuring iSCSI in CentOS / RHEL 7
  3. showmount Command Examples in Linux
  4. How to install and configure MariaDB in CentOS / RHEL 7
  5. How to create snapshot of LVM thin volumes using snapper command
  6. How to Create a New /boot Partition in CentOS / RHEL
  7. Linux “seq” Command Examples
  8. How to configure and Manage Network Connections using nmcli
  9. How to Increase KVM Guest Memory Resources
  10. MySQL Server Error – “Can’t Create A New Thread (errno 11)”

You May Also Like

Primary Sidebar

Recent Posts

  • What are /dev/zero and /dev/null files in Linux
  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright