Bug 170367 - chkconfig- bug when use LSB compliant "Required-Start:"
chkconfig- bug when use LSB compliant "Required-Start:"
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: chkconfig (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Ben Levenson
Depends On:
Blocks: 168424
  Show dependency treegraph
Reported: 2005-10-10 20:46 EDT by Jay Turner
Modified: 2015-01-07 19:10 EST (History)
6 users (show)

See Also:
Fixed In Version: RHBA-2006-0017
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-15 10:44:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jay Turner 2005-10-10 20:46:01 EDT
+++ This bug was initially created as a clone of Bug #168457 +++

Description of problem:
when using LSB compliant "Required-Start:" , chkconfig does not create the 
appropriate Snnfoo scripts.
This can result in Start and Stop scripts not being run in the sequential order 
that the developer intended these scripts to be run.
Additionally, chkconfig creates S-1foo named scripts, which are not removed 
when one executes # chkconfig --del foo

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

How reproducible:
cat /etc/init.d/foo 
#!/bin/sh #
# chkconfig:      345 40 60
# description:    foo script
# Required-Start: $network

Steps to Reproduce 1 bug:
# chkconfig --list foo service foo supports chkconfig, but is not referenced in 
any runlevel (run 'chkconfig --add foo')
# chkconfig --add foo
# find . -name "*foo*"
./rc4.d/S-1foo    <=== huh?
./rc5.d/S-1foo    <=== huh?
./rc3.d/S-1foo    <=== huh?

Actual results:
./rc4.d/S-1foo    <=== huh?
./rc5.d/S-1foo    <=== huh?
./rc3.d/S-1foo    <=== huh?

Expected results:

Steps to reproduce 2 bug
# chkconfig --del foo

Actual results
# find . -name "*foo*"

-- Additional comment from notting@redhat.com on 2005-09-16 12:16 EST --

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

-- Additional comment from notting@redhat.com on 2005-10-07 16:13 EST --
Reopening, this is not a duplicate of 161870.

-- Additional comment from notting@redhat.com on 2005-10-07 16:15 EST --
*** Bug 163389 has been marked as a duplicate of this bug. ***
Comment 3 gajanovic_dan 2005-11-09 21:40:55 EST
Looking at chkconfig.c v1.3.13.2, line 171, we have:

    if (s.isLSB && (s.sPriority <= -1) && (s.kPriority <= -1))

Consider initd scripts foo and bar:

# foo
# chkconfig: 35 95 10
# Required-Start: network


# bar
# chkconfig: 35 95 10
# Required-Stop: network

In both cases, only one of Required-Start/Required-Stop is provided
(which is valid according to the LSB spec going back as far as 1.0).
However, after readServiceInfo(), we will have
(s.isLSB, s.sPriority, s.kPriority) set to
(1, -1, 10) and (1, 95, -1), respectively. In both cases, addService()
concludes that the script is not LSB-compliant, and proceeds to use
-1 verbatim. The result will be S-1foo and K-1bar. 

If chkconfig decides that it will ignore the LSB-style directives, then
it should at least not let them corrupt the information provided by
'# chkconfig:' and vice versa.

In prior versions of chkconfig, foo and bar used to be installed properly
using the info provided by '# chkconfig:'. breaks these scripts.
Comment 4 Bill Nottingham 2005-11-10 18:31:39 EST
Built in
Comment 11 Red Hat Bugzilla 2006-03-15 10:44:25 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.