Bug 76024
Summary: | chkconfig man pages should mention LSB support | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | David Tonhofer <bughunt> | ||||
Component: | chkconfig | Assignee: | Bill Nottingham <notting> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Ben Levenson <benl> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 7.3 | CC: | bugs.michael, lenz, mitr, rvokal | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2003-01-31 21:06:50 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: | |||||||
Attachments: |
|
Description
David Tonhofer
2002-10-15 21:28:44 UTC
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 # 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. Created attachment 80949 [details]
Here's my file that gave me trouble. It's a modified mysql startup script. It actually reproduces the error
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? 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. No wonder! Expected behaviour I would say: * Tue Mar 12 2002 Bill Nottingham <notting> 1.3.2-1 - chkconfig: LSB support 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 Woops, yeah, this is expected (the LSB support.) Changing bug summary appropriately. Minimally documented in 1.3.7-1. 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! |