Bug 76024 - chkconfig man pages should mention LSB support
chkconfig man pages should mention LSB support
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: chkconfig (Show other bugs)
7.3
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-15 17:28 EDT by David Tonhofer
Modified: 2014-03-16 22:31 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-31 16:06:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Here's my file that gave me trouble. It's a modified mysql startup script. It actually reproduces the error (4.50 KB, text/plain)
2002-10-18 12:35 EDT, David Tonhofer
no flags Details

  None (edit)
Description David Tonhofer 2002-10-15 17:28:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
"chkconfig --add <service>" based on the config lines in the service's 
script ... mysteriously adds K-links instead of S-links. W00t?

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


How reproducible:
Always

Steps to Reproduce:
Here is what I want to do:

- Add the service mysql-slave (a slaved MySQL server) to the system

How do I do it:

- I have the script /etc/rc.d/init.d/mysql-slave ready
- The script contains the follwoing two lines for chkconfig:
  
# chkconfig: 2345 20 80
# description: A very fast and reliable SQL database engine but bitchy to get 
to start

- No symlinks for that service exist in /etc/rc?.d

- I run chkconfig --add mysql-slave


Actual Results:  What happens:

 /etc/rc0.d/K80mysql-slave -> ../init.d/mysql-slave
 /etc/rc1.d/K80mysql-slave -> ../init.d/mysql-slave
 /etc/rc2.d/S20mysql-slave -> ../init.d/mysql-slave
 /etc/rc3.d/K20mysql-slave -> ../init.d/mysql-slave <-- ?
 /etc/rc4.d/S20mysql-slave -> ../init.d/mysql-slave
 /etc/rc5.d/K20mysql-slave -> ../init.d/mysql-slave <-- ?
 /etc/rc6.d/K80mysql-slave -> ../init.d/mysql-slave

Indeed, we find:

$ chkconfig --list mysql-slave

  mysql-slave     0:off   1:off   2:on    3:off   4:on    5:off   6:off


Expected Results:  What do I think should happen:

- Start and kill links should be created, with:

 /etc/rc0.d/K80mysql-slave -> ../init.d/mysql-slave
 /etc/rc1.d/K80mysql-slave -> ../init.d/mysql-slave
 /etc/rc2.d/S20mysql-slave -> ../init.d/mysql-slave
 /etc/rc3.d/S20mysql-slave -> ../init.d/mysql-slave
 /etc/rc4.d/S20mysql-slave -> ../init.d/mysql-slave
 /etc/rc5.d/S20mysql-slave -> ../init.d/mysql-slave
 /etc/rc6.d/K80mysql-slave -> ../init.d/mysql-slave



Additional info:

Let's reproduce it with

# chkconfig: 2345 64 37
# description: A very fast and reliable SQL database engine.

Again, we end up with:

 /etc/rc0.d/K37mysql-slave -> ../init.d/mysql-slave
 /etc/rc1.d/K37mysql-slave -> ../init.d/mysql-slave
 /etc/rc2.d/S64mysql-slave -> ../init.d/mysql-slave
 /etc/rc3.d/K37mysql-slave -> ../init.d/mysql-slave <-- ?
 /etc/rc4.d/S64mysql-slave -> ../init.d/mysql-slave
 /etc/rc5.d/K37mysql-slave -> ../init.d/mysql-slave <-- ?
 /etc/rc6.d/K37mysql-slave -> ../init.d/mysql-slave

This can be:

a) a bug (unlikely, this seems to be straightforward program)
b) an undocumented feature of *something*
Comment 1 Michael Schwendt 2002-10-18 11:29:29 EDT
Cannot reproduce this here, neither with my own scripts nor with any other
scripts in /etc/init.d. For instance:

# grep chkconfig /etc/init.d/random
# chkconfig: 2345 20 80

# chkconfig --del random
# find /etc/rc.d/rc?.d -name \*random
# chkconfig --add random
# find /etc/rc.d/rc?.d -name \*random
/etc/rc.d/rc0.d/K80random
/etc/rc.d/rc1.d/K80random
/etc/rc.d/rc2.d/S20random
/etc/rc.d/rc3.d/S20random
/etc/rc.d/rc4.d/S20random
/etc/rc.d/rc5.d/S20random
/etc/rc.d/rc6.d/K80random
#
Comment 2 Bill Nottingham 2002-10-18 12:14:04 EDT
I can not reproduce this in quick testing on 8.0 either; the code is pretty much
the same between 8.0 and 7.3.
Comment 3 David Tonhofer 2002-10-18 12:35:22 EDT
Created attachment 80949 [details]
Here's my file that gave me trouble. It's a modified mysql startup script. It actually reproduces the error
Comment 4 David Tonhofer 2002-10-18 12:37:28 EDT
The example file attached earlier can be made to work with chkconfig by
removing the part

# Comments to support LSB init script conventions
### BEGIN INIT INFO
# Provides: mysql
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:  3 5
# Default-Stop: 3 5
# Short-Description: start and stop MySLQ
# Description: MySQL is a very fast and reliable SQL database engine.
### END INIT INFO

....so this may be normal behaviour of chkconfig. But it's definitely
unexpected. Can you reproduce?
Comment 5 Michael Schwendt 2002-10-18 12:58:37 EDT
Can't reproduce it (the LSB part interferes, though).

# chkconfig --del test
# chkconfig --add test
# find /etc/rc.d/rc?.d/ -name \*test
/etc/rc.d/rc0.d/K90test
/etc/rc.d/rc1.d/K90test
/etc/rc.d/rc2.d/K90test
/etc/rc.d/rc3.d/S90test
/etc/rc.d/rc4.d/S90test
/etc/rc.d/rc5.d/S90test
/etc/rc.d/rc6.d/K90test
# grep chkconfig test
# Comments to support chkconfig on RedHat Linux
# chkconfig: 345 90 90

But I've noticed the file uses Windows-style line delimiters. Run dos2unix on
it. Maybe that fixes it for you.
Comment 6 Michael Schwendt 2002-10-18 13:02:37 EDT
No wonder! Expected behaviour I would say:

* Tue Mar 12 2002 Bill Nottingham <notting@redhat.com> 1.3.2-1

- chkconfig: LSB support
Comment 7 David Tonhofer 2002-10-18 13:22:50 EDT
Bingo! But what now? Shouldn't this fact be mentioned in the man page?

Just for reference:

I have just checked again (also did the dos2unix part but the CRLF only
occur because I'm sending the from W2K I guess)

$ dos2unix -o foobar

Currently we have the LSB part:

$ chkconfig --add foobar
$ chkconfig --list foobar
foobar          0:off   1:off   2:off    3:on    4:off    5:on    6:off

$ chkconfig --del foobar

Delete the LSB part...

$ chkconfig --add foobar
$ chkconfig --list foobar

foobar          0:off   1:off   2:on    3:on    4:on    5:on    6:off

$ rpm --query chkconfig
chkconfig-1.3.5-3
Comment 8 Bill Nottingham 2002-10-18 14:25:50 EDT
Woops, yeah, this is expected (the LSB support.)

Changing bug summary appropriately.
Comment 9 Bill Nottingham 2003-01-31 16:06:50 EST
Minimally documented in 1.3.7-1.
Comment 10 Lenz Grimmer 2003-04-11 06:01:30 EDT
It seems like that chkconfig still gets confused when both the chkonfig header and 
the LSB header are present - I currently face this problem while trying to provide 
an init script for MySQL that supports both chkconfig (e.g. Red Hat and deratives or 
Mandrake Linux), but also LSB conformant distributions (e.g. SuSE and United Linux). 
Currently, our init script has the following header information: 
 
[SNIP] 
# Comments to support chkconfig on RedHat Linux 
# chkconfig: 2345 90 90 
# description: A very fast and reliable SQL database engine. 
 
# Comments to support LSB init script conventions 
### BEGIN INIT INFO 
# Provides: mysql 
# Required-Start: $local_fs $network $remote_fs 
# Required-Stop: $local_fs $network $remote_fs 
# Default-Start:  2 3 4 5 
# Default-Stop: 2 3 4 5 
# Short-Description: start and stop MySQL 
# Description: MySQL is a very fast and reliable SQL database engine. 
### END INIT INFO 
[SNIP] 
 
As you can see, both headers define run levels 2-5 for starting MySQL. However, 
"chkconfig --add" only adds it to run level 2 and 4: 
 
# chkconfig --list mysql 
service mysql supports chkconfig, but is not referenced in any runlevel (run 'chkconfig 
--add mysql') 
# chkconfig --add mysql 
# chkconfig --list mysql 
mysql           0:off   1:off   2:off   3:off   4:off   5:off   6:off 
 
If I remove the LSB header part, it adds it to the approriate run levels. 
If I remove the chkconfig headers and only keep the LSB headers, it does not add 
it to any run level at all: 
 
# chkconfig --list mysql 
service mysql supports chkconfig, but is not referenced in any runlevel (run 'chkconfig 
--add mysql') 
# chkconfig --add mysql 
# chkconfig --list mysql 
service mysql supports chkconfig, but is not referenced in any runlevel (run 'chkconfig 
--add mysql') 
 
It seems to me as if the LSB support is not fully functional yet. I'd appreciate, if you 
could investigate this. Thanks! 

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