Bug 161870 - chkconfig LSB dependency frobber fails if the dep has no chkconfig line
chkconfig LSB dependency frobber fails if the dep has no chkconfig line
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: chkconfig (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Ben Levenson
Depends On:
Blocks: 168429
  Show dependency treegraph
Reported: 2005-06-27 19:07 EDT by David Lehman
Modified: 2014-03-16 22:54 EDT (History)
7 users (show)

See Also:
Fixed In Version: RHBA-2006-0018
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-07 13:32:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
set default start/stop priority for potential dependencies if they have no chkconfig line (598 bytes, patch)
2005-06-27 19:07 EDT, David Lehman
no flags Details | Diff
Updated chkconfig.c with recursive dependancy resolution (13.53 KB, text/plain)
2005-10-04 04:38 EDT, Jean-François LARVOIRE
no flags Details

  None (edit)
Description David Lehman 2005-06-27 19:07:22 EDT
Description of problem:
frobDependencies doesn't set default start/stop priority on scripts (those other
than the one being added -- the 'servs' list) with no chkconfig line. As a
result, the start/stop priorities of both scripts in a short dependency chain
will end up with priority 50 which defeats the purpose.

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

How reproducible:

Steps to Reproduce:
1. create two scripts, neither with chkconfig line
2. make it so s2 depends (Required-Start) on s1 and s1 provides s1
3. run 'chkconfig --add' or install_initd on s1 then s2
Actual results:
both scripts will have start/stop priority of 50 which means dependencies are
effectively ignored

Expected results:
s1 should have priority 50 and s2 should have priority 51 to ensure the
dependency on s1 is satisfied at start

Additional info:
Comment 1 David Lehman 2005-06-27 19:07:23 EDT
Created attachment 116039 [details]
set default start/stop priority for potential dependencies if they have no chkconfig line
Comment 2 Ulf Zimmermann 2005-07-27 22:49:24 EDT
I found the same problem with the addition of a chkconfig: line being present. 
From the hpasm init script (HP Agents for System Management):


# Copyright 2002 hp Information Technologies Group, L.P.
# See "man chkconfig" for information on next two lines (Red Hat only)
# chkconfig: 2345 91 1
# description: HP Advanced System Management Drivers and Agents for Linux
# Following lines are in conformance with LSB 1.2 spec
# Provides:            hpasm
# Required-Start:      snmp
# Required-Stop:       hprsm cmanic cmastor
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Description:         starts hpasm (HP Advanced System Management Drivers and 

The chkconfig: line has 91 as the start priority but it created as 50, stop is 
1 and it gets created with 0. chkconfig-1.3.11-0.3.i386.rpm and ntsysv-1.3.11-
0.3.i386.rpm do not have this problem.
Comment 3 Ulf Zimmermann 2005-07-27 22:50:34 EDT
Forgot to check snmpd init.d file, it has:

# chkconfig: - 50 50
Comment 4 Ulf Zimmermann 2005-07-27 22:51:37 EDT
Sorry, forgot to mention, I have been doing this on EL3, not 4 as the original 
Comment 5 Shawn Bohrer 2005-09-13 16:19:47 EDT
I have also experienced the same issue on RHE WS 3 with chkconfig
First it appears that if both chkconfig comments, and LSB comments are present
it defaults to using the LSB comments.  As noted above if you set a start
dependency  on scripts that have no LSB comments, and only have chkconfig
comment, the dependency will be resolved correctly.  However if you set a start
dependency on a script that contains LSB comments, even if it also contains
chkconfig comments the start priorty will default to 50, and the dependency will
be ignored.

It appeared to me that this issue does not occur when setting a stop dependency
on scripts that contained LSB comments. 
Comment 6 Bill Nottingham 2005-09-16 12:16:26 EDT
*** Bug 168457 has been marked as a duplicate of this bug. ***
Comment 7 Jean-François LARVOIRE 2005-10-04 04:38:15 EDT
Created attachment 119580 [details]
Updated chkconfig.c with recursive dependancy resolution


I had the same problem as Dave Lehman, with multiple dependancies not resolved
Here's an updated version (based on 1.3.20) that recursively resolves the start
order for all other dependancies, before assigning the start order for the
target script.

This works well in cases such as s2 depending on s1, which in turns depends on

There are still many possible improvements.
For example, when the dependancies are not resolved, instead of defaulting to
S50, it would be better to default to the "old" start order provided in the
"chkconfig:" header line.
Comment 14 Bill Nottingham 2005-11-10 18:32:17 EST
Built in
Comment 19 Red Hat Bugzilla 2006-03-07 13:32:21 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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