red hat chkconfig to manage logical booleans?

Dirk Koopman djk at tobit.co.uk
Thu Nov 8 22:07:55 GMT 2007


David Alban wrote:

> 
> So you ended up with an implementation of a set of arbitrary logical
> booleans.  The state of each of these booleans was kept in a file:
> 
>  /etc/config/$FEATURE_NAME
> 
> which contained, literally the word 'on' or the word 'off'.
> 
> Red Hat took this and modified it so that adding a new feature
> essentially created hard links from rcN.d directories to /etc/init.d/
> scripts.  Removing a feature would delete the rcN.d links.  You could
> add/delete features from different run levels

The problem is that RedHat took the name (and the immediate and obvious 
use) of chkconfig and then re-implemented it to just do runlevel 
maintenance.

If you look closely, chkconfig does not "delete" rcN.d links when you 
say "off", it merely changes the name of the link to the Knn priority 
that is set in the comment section of the init script.

For example: nfs

#!/bin/sh
#
# nfs           This shell script takes care of starting and stopping
#               the NFS services.
#
# chkconfig: - 60 20
# description: NFS is a popular protocol for file sharing across TCP/IP
#              networks. This service provides NFS server functionality,
#              which is configured via the /etc/exports file.
# probe: true
# config: /etc/sysconfig/nfs

The first number is for "on", as in S60nfs and the second for "off", as 
in "K20nfs".

I will concede that it *can* delete the links completely, but most 
people don't use it like that and use it just for "on" or "off" 
services. In fact, the man pages state this explicitly:

"This  implementation of chkconfig was inspired by the chkconfig command
present in the IRIX operating system. Rather than maintaining  configu- 
      ration  information  outside  of the /etc/rc[0-6].d hierarchy, 
however,
this version directly manages  the  symlinks  in  /etc/rc[0-6].d.  This
leaves  all  of  the  configuration information regarding what services
init starts in a single location."

So it won't do what you want. It just does what RedHat wants.

Dirk




More information about the london.pm mailing list