Bug 106193 - chkconfig doesn't parse LSB comments
chkconfig doesn't parse LSB comments
Status: CLOSED ERRATA
Product: Red Hat Raw Hide
Classification: Retired
Component: chkconfig (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks: 132991 132992 137160
  Show dependency treegraph
 
Reported: 2003-10-03 11:40 EDT by Eric Sandeen
Modified: 2014-03-16 22:39 EDT (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2005-118
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-04-28 11:20:02 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)
patch for the issue mentioned (1.28 KB, patch)
2005-01-13 13:09 EST, Bill Nottingham
no flags Details | Diff
better patch (1.87 KB, patch)
2005-01-13 22:58 EST, Bill Nottingham
no flags Details | Diff

  None (edit)
Description Eric Sandeen 2003-10-03 11:40:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20030131

Description of problem:
Since redhat-lsb provides /usr/lib/lsb/install_initd (as a symlink
to /sbin/chkconfig), I assumed that calling install_initd on an
initscript with lsb-compliant header comments would install the
initscript.  This seems to not be the case.

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

How reproducible:
Always

Steps to Reproduce:
1. create dummy /etc/init.d/foo:

#! /bin/sh
#
### BEGIN INIT INFO
# Provides: foo
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Description: Start foo
### END INIT INFO

2. call /usr/lib/lsb/install_initd foo

3. call chkconfig --list foo
    

Actual Results:  service foo supports chkconfig, but is not referenced in any
runlevel (run 'chkconfig --add foo')


Expected Results:  The LSB-compliant initscript should have been installed into
the correct runlevels

Additional info:

I realize that LSB initscripts work in pretty different ways than
Red Hat Linux scripts, esp. with the # Required-Start: $network constructs,
etc.  OTOH, I thought redhat-lsb would give me what I needed to
make this work.  Any comments?

Thanks,

-Eric
Comment 1 Bodo Meissner 2004-06-04 04:30:31 EDT
On Red Hat Enterprise Linux ES release 3 (Taroon) links in /etc/rc?.d
will be installed by /usr/lib/lsb/install_intd /etc/init.d/foo but
with start and stop priority -1, e.g.
/etc/rc0.d/K-1foo -> ../init.d/foo
/etc/rc3.d/S-1foo -> ../init.d/foo

According to lsb_release output this distribution claims to be LSB 1.3
compliant, so it should install startup scripts according to LSB
specification.
Comment 2 Jeff Lawson 2004-10-04 15:01:27 EDT
On Redhat Enterprise ES 3 I am seeing a similar problem.

However, with my own initscript I am not seeing the behavior of start
and stop priority "-1" symlinks being created at all, regardless of
whether I use install_initd or "chkconfig --add scriptname" directly.
 My init script even includes both the old style and new LSB style
comments in it:

# chkconfig: 35 99 28
# description: Sample program

### BEGIN INIT INFO
# Default-Start:  3 5
# Default-Stop:   0 1 3 5 6
# Short-Description:  Sample program
# Description:  Sample program
### END INIT INFO
Comment 3 Jeff Lawson 2004-10-04 15:24:16 EDT
I think bug 85678 may fix this, for which an errata for both RHEL 2.1
and RHEL 3.0 has already been released.
Comment 4 Bill Nottingham 2004-10-04 16:21:20 EDT
Can you reproduce this with the errata version?
Comment 5 Jeff Lawson 2004-10-04 16:30:04 EDT
I've just installed the errata, and it seems that having both types of
comment blocks in the same initscript confuses chkconfig somehow. 
With the lines from comment 2 in a sample initscript, I only see these
symlinks created:

/etc/rc.d/rc0.d/K28foo
/etc/rc.d/rc1.d/K28foo
/etc/rc.d/rc2.d/K28foo
/etc/rc.d/rc3.d/K28foo
/etc/rc.d/rc4.d/K28foo
/etc/rc.d/rc5.d/K28foo
/etc/rc.d/rc6.d/K28foo

When I remove the old style comment and leave ONLY the LSB style, I
see these links created:

/etc/rc.d/rc0.d/K50foo
/etc/rc.d/rc1.d/K50foo
/etc/rc.d/rc2.d/S50foo
/etc/rc.d/rc3.d/K50foo
/etc/rc.d/rc4.d/S50foo
/etc/rc.d/rc5.d/K50foo
/etc/rc.d/rc6.d/K50foo

Repositioning the old style comments below the LSB block doesn't seem
to help.  Removing the LSB block and leaving ONLY the old style block:

/etc/rc.d/rc0.d/K28foo
/etc/rc.d/rc1.d/K28foo
/etc/rc.d/rc2.d/K28foo
/etc/rc.d/rc3.d/S99foo
/etc/rc.d/rc4.d/K28foo
/etc/rc.d/rc5.d/S99foo
/etc/rc.d/rc6.d/K28foo

It would be nice to be able to allow both styles of comments in the
same file so that my startup script can be compatible with multiple
distributions.
Comment 6 Jeff Lawson 2004-10-04 17:09:30 EDT
FYI, the original report mentioned in comment #1 does not repro for me
using the errata version:

[root@moltar root]# /usr/lib/lsb/install_initd /etc/init.d/foo
[root@moltar root]# chkconfig --list foo
foo             0:off   1:off   2:off   3:on    4:on    5:on    6:off

but my comment #5 still stands.
Comment 7 Bill Nottingham 2005-01-13 13:09:33 EST
Created attachment 109733 [details]
patch for the issue mentioned

This patch makes LSB comments take precendence always over '# ckhconfig:'
lines.
Comment 8 Bill Nottingham 2005-01-13 22:58:30 EST
Created attachment 109769 [details]
better patch
Comment 13 Jeff Lawson 2005-03-09 13:50:49 EST
Is there an estimate for when that patch will be committed?
Comment 14 Bill Nottingham 2005-03-09 14:10:46 EST
It's currently scheduled for the next update releases.
Comment 15 Jay Turner 2005-03-17 09:15:52 EST
I'm still seeing some issues with initscripts-7.93.13.EL-1.i386 on RHEL4.  With
the initscript from comment 2, I'm getting the following after running
install_initd:

# chkconfig --list foo
foo             0:off   1:off   2:off   3:off   4:off   5:off   6:off

# ls /etc/rc*/*foo
/etc/rc0.d/K28foo  /etc/rc2.d/K28foo  /etc/rc4.d/K28foo  /etc/rc6.d/K28foo
/etc/rc1.d/K28foo  /etc/rc3.d/K28foo  /etc/rc5.d/K28foo

Comment 16 Bill Nottingham 2005-03-17 14:47:58 EST
The initscript in comment 2 says:

### BEGIN INIT INFO
# Default-Start:  3 5
# Default-Stop:   0 1 3 5 6

The default-stop is overriding the default-start.

Jay, which version of chkconfig are you using?
Comment 17 Jay Turner 2005-03-18 02:41:02 EST
I really should have noticed that . . . sorry, I'm an idiot.  I'll retest with
correct initscripts.  Also not really sure why I posted the initscripts version
above.  I suspect I'm going to find that I updated the wrong package.
Comment 18 Jay Turner 2005-03-30 07:13:50 EST
chkconfig-1.3.13.2-1 makes things all better and is included in the latest
U1-candidate builds.
Comment 19 John Flanagan 2005-04-28 11:20:02 EDT
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.

http://rhn.redhat.com/errata/RHBA-2005-115.html
Comment 20 Jeff Lawson 2005-04-28 16:02:33 EDT
That errata is for ES 2.1; will there be an errata for ES 3 also (and maybe ES 4)?

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