Bug 237097 - chkconfig misbehaves with LSB style INIT INFO blocks
chkconfig misbehaves with LSB style INIT INFO blocks
Status: CLOSED DUPLICATE of bug 166716
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: chkconfig (Show other bugs)
4.4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-19 08:58 EDT by Bryn M. Reeves
Modified: 2014-03-16 23:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-19 13:19:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
trace of chkconfig on fc6 (1.23 KB, text/plain)
2007-04-19 09:06 EDT, Bryn M. Reeves
no flags Details
trace of chkconfig on rhel4 (1.32 KB, text/plain)
2007-04-19 09:07 EDT, Bryn M. Reeves
no flags Details

  None (edit)
Description Bryn M. Reeves 2007-04-19 08:58:18 EDT
Description of problem:
LSB defines INIT INFO blocks as an alternate way of specifying dependencies
between services. For example:

# AFS   Start and stop AFS components
#
#
# chkconfig: 35 60 20
# description:  AFS is a distributed file system which provides location
#               transparency, caching and secure authentication.
#               Additional configuration can be done in the /etc/sysconfig/afs
#               file. Read the documentation in that file for more information.
#
# The following section is used at least by SuSE insserv(8)
### BEGIN INIT INFO
# Provides: afs
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description:  AFS is a distributed file system which provides location
#              transparency, caching and secure authentication.
#              Additional configuration can be done in the /etc/sysconfig/afs
#              file. Read the documentation in that file for more information.
### END INIT INFO

Without the LSB block, you would expect the "# chkconfig: 35 60 20" line to link
the scripts like this:

$ ls -l rc?.d/*afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc0.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc1.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc2.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc3.d/S60afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc4.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc5.d/S60afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc6.d/K20afs -> ../init.d/afs

When adding this service using RHEL4's chkconfig and the LSB INIT INFO block you
get this:

$ ls -l rc?.d/*afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc0.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc1.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc2.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc3.d/S99afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc4.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc5.d/S99afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc6.d/K01afs -> ../init.d/afs

This is not reproducible on FC6 with chkconfig-1.3.30-1. Strangely, rebuilding
this version of chkconfig on RHEL4 still has the problem so I'm assuming that
something has changed in the environment that is affecting chkconfig's
operation. chkconfig only really depends on libc:

$ ldd /sbin/chkconfig 
        linux-gate.so.1 =>  (0x005ea000)
        libc.so.6 => /lib/i686/nosegneg/libc.so.6 (0x41000000)
        /lib/ld-linux.so.2 (0x461a8000)

So my first thought was a locale/sort/collate change, but running in the C
locale didn't change things.


Version-Release number of selected component (if applicable):
chkconfig-1.3.13.4-1
chkconfig-1.3.30-1

How reproducible:
100%

Steps to Reproduce:
1. add an initscript with LSB INIT INFO block using chkconfig:
# chkconfig --add <script>
2. examine symlink start/stop orders:
$ ls /etc/rc.d/rc?.d/*<script>

  
Actual results:
K/S numbers are wrong, for e.g. the afs script gives K01/S99 and the ipmi script
from OpenIPMI gives K87 (it's off by default):

 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc0.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc1.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc2.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc3.d/S99afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc4.d/K01afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc5.d/S99afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 20 11:54 rc6.d/K01afs -> ../init.d/afs


Expected results:

Start/stop ordering obeys either the chkconfig line or the LSB INIT INFO block.

For AFS:

 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc0.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc1.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc2.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc3.d/S60afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc4.d/K20afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc5.d/S60afs -> ../init.d/afs
 lrwxrwxrwx  1 root root 13 Feb 13 18:57 rc6.d/K20afs -> ../init.d/afs

Additional info:

A lot of 3rd party initscripts seem to be including the INIT INFO block now;
mysql, hp's monitoring services, OpenIPMIetc.
Comment 1 Bryn M. Reeves 2007-04-19 09:05:43 EDT
Adding some very simple tracing to chkconfig produces very different results on
FC6 and RHEL4 for the same chkconfig version. For e.g. adding a printf on entry
to these functions:

addService
frobDependencies
frobOneDependencies
delServiceOne

Yields a quite different looking trace on the two versions of the distro with
chkconfig-1.3.30-1.

Attaching these as chkconfig-rhel4.trace and chkconfig-fc6.trace.
Comment 2 Bryn M. Reeves 2007-04-19 09:06:29 EDT
Created attachment 153001 [details]
trace of chkconfig on fc6
Comment 3 Bryn M. Reeves 2007-04-19 09:07:07 EDT
Created attachment 153002 [details]
trace of chkconfig on rhel4
Comment 4 Bill Nottingham 2007-04-19 13:03:59 EDT
Do you have NetworkManager installed?
Comment 5 Bryn M. Reeves 2007-04-19 13:16:34 EDT
Yes on both the fc6 and RHEL4 machines I've tested with. Will check with the
original reporter for their configuration.
Comment 6 Bryn M. Reeves 2007-04-19 13:18:08 EDT
Removing network manager gives the expected behavior with afs' initscript on my
RHEL4 test box.
Comment 7 Bill Nottingham 2007-04-19 13:19:19 EDT
NM in RHEL 4 provides $network, chkconfig is honoring that.

*** This bug has been marked as a duplicate of 166716 ***

*** This bug has been marked as a duplicate of 166716 ***

Note You need to log in before you can comment on or make changes to this bug.