Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 246076

Summary: Chkconfig LSB dependency processing very brittle
Product: Red Hat Enterprise Linux 4 Reporter: Ryan Thomas <ryan.thomas>
Component: chkconfigAssignee: Bill Nottingham <notting>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 4.5CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-28 13:27:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.