Bug 106193

Summary: chkconfig doesn't parse LSB comments
Product: [Retired] Red Hat Raw Hide Reporter: Eric Sandeen <sandeen>
Component: chkconfigAssignee: Bill Nottingham <notting>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: ezannoni, jlawson-redhat, jturner, k.georgiou, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2005-118 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-04-28 15:20:02 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:
Bug Depends On:    
Bug Blocks: 132991, 132992, 137160    
Attachments:
Description Flags
patch for the issue mentioned
none
better patch none

Description Eric Sandeen 2003-10-03 15:40:01 UTC
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 08:30:31 UTC
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 19:01:27 UTC
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 19:24:16 UTC
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 20:21:20 UTC
Can you reproduce this with the errata version?

Comment 5 Jeff Lawson 2004-10-04 20:30:04 UTC
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 21:09:30 UTC
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 18:09:33 UTC
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-14 03:58:30 UTC
Created attachment 109769 [details]
better patch

Comment 13 Jeff Lawson 2005-03-09 18:50:49 UTC
Is there an estimate for when that patch will be committed?

Comment 14 Bill Nottingham 2005-03-09 19:10:46 UTC
It's currently scheduled for the next update releases.

Comment 15 Jay Turner 2005-03-17 14:15:52 UTC
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 19:47:58 UTC
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 07:41:02 UTC
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 12:13:50 UTC
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 15:20:02 UTC
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 20:02:33 UTC
That errata is for ES 2.1; will there be an errata for ES 3 also (and maybe ES 4)?