blog-banner

Fix Chkconfig Command Not Found

  • CENTOS
  • CHKCONFIG
  • LINUX SERVER

Chkconfig: command not found

It happened in one of the servers we maintain, chkconfig was installed but it couldn't be loaded. Below is the sequence of commands I used to find the cause and fix it.

[[{"type":"media","view_mode":"media_large","fid":"104","attributes":{"alt":"","class":"media-image","typeof":"foaf:Image"}}]]

# It was needed to have tomcat start at boot time

$ sudo chkconfig --add tomcat  
-bash: chkconfig: command not found

# I thought it was not installed but it is in place.

$ sudo yum install chkconfig
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirror.symnds.com
 * extras: mirror.cogentco.com
 * updates: mirror.lug.udel.edu
Setting up Install Process
Package chkconfig-1.3.30.2-2.el5.x86_64 already installed and latest version
Nothing to do

# A quick Google search suggested that it could be located at /sbin/chkconfig.

$ sudo /sbin/chkconfig
chkconfig version 1.3.30.2 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage:   chkconfig --list [name]
         chkconfig --add <name>
         chkconfig --del <name>
         chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>

# Where does bash expect to have the chkconfig script?

$ sudo which chkconfig
which: no chkconfig in (/usr/bin:/bin)

# Okay, let's create a symbolic link

sudo ln -s /sbin/chkconfig /usr/bin/

# Is it working now?

$ sudo chkconfig
chkconfig version 1.3.30.2 - Copyright (C) 1997-2000 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License.

usage:   chkconfig --list [name]
         chkconfig --add <name>
         chkconfig --del <name>
         chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>

Yes, it is !!

{ "@context": "http://schema.org", "@type": "Product", "name": "Fix Chkconfig Command Not Found", "aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.5", "ratingCount": "95", "reviewCount": "280" } }