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*
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!