Bug 246076 - Chkconfig LSB dependency processing very brittle
Summary: Chkconfig LSB dependency processing very brittle
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: chkconfig
Version: 4.5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-28 12:07 UTC by Ryan Thomas
Modified: 2014-03-17 03:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-28 13:27:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ryan Thomas 2007-06-28 12:07:54 UTC
Description of problem:

chkconfig LSB processing is truly brittle.  I have a case where I get different
results with two init scripts that only differ in the presence of a single
comment line.  If the comment line is removed, start/stop sequences are correct
if it is present chkconfig comes up with to S99/K01 levels.

So here is the start of the script I was writing.

#!/bin/sh
#
# myservice - Illustrates a bug in chkconfig
#
# /etc/rc.d/init.d/myservice
#
# chkconfig: 345 58 22
# description: Bug reporting
#
### BEGIN INIT INFO
# Provides: feedback
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Required-Start: $network
# Required-Stop: $network
# Description:  none

If the "### BEGIN INIT INFO" line is present then I get S99/K01 links

# grep BEGIN /etc/rc.d/init.d/myservice; echo; chkconfig --del myservice;
chkconfig --add myservice; find /etc/rc.d/ -name \*myservice
### BEGIN INIT INFO

/etc/rc.d/rc5.d/S99myservice
/etc/rc.d/rc3.d/S99myservice
/etc/rc.d/rc6.d/K01myservice
/etc/rc.d/rc2.d/K01myservice
/etc/rc.d/rc0.d/K01myservice
/etc/rc.d/rc1.d/K01myservice
/etc/rc.d/rc4.d/S99myservice
/etc/rc.d/init.d/myservice


If I remove it, the links are as expected

grep BEGIN /etc/rc.d/init.d/myservice; echo; chkconfig --del myservice;
chkconfig --add myservice; find /etc/rc.d/ -name \*myservice

/etc/rc.d/rc5.d/S58myservice
/etc/rc.d/rc3.d/S58myservice
/etc/rc.d/rc6.d/K22myservice
/etc/rc.d/rc2.d/K22myservice
/etc/rc.d/rc0.d/K22myservice
/etc/rc.d/rc1.d/K22myservice
/etc/rc.d/rc4.d/S58myservice
/etc/rc.d/init.d/myservice

Part of the problem is the "$network" dependency which in RHEL 4.5 can be
multiply defined by the network and NetworkManager rc scripts

# grep Provides: /etc/rc.d/init.d/* | grep network
/etc/rc.d/init.d/NetworkManager:# Provides: $network
/etc/rc.d/init.d/network:# Provides: $network

If I remove the NetworkManager package, then chkconfig always gives the right
start/stop levels even if the troublesome comment line is present.

I've checked the chkconfig released with Fedora 7 (1.3.34) as well and found
processing is still broken with that version.

Version-Release number of selected component (if applicable): RHEL 4.5 AS

The packages installed currently are:

initscripts-7.93.25.EL-1
NetworkManager-0.3.1-3
chkconfig-1.3.13.4-1


How reproducible: 100%


Steps to Reproduce:
1. Install NetworkManager and initscripts RPMS so that the $network dependency
is multiply defined.
2. Create a startup script with chkconfig comments as listed above
3. chkconfig delete and add the service and check the symlinks created.
  
Actual results:

see above

Expected results:

see above

Additional info:

Comment 1 Bill Nottingham 2007-06-28 13:27:44 UTC
This is the intended behavior.

1) ### BEGIN INIT INFO implies you want to set priorities via LSB dependencies
2) $network is/was provided by NetworkManager, so that affects where your script
is ordered. This is actually changed in later NetworkManager releases.




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