Bug #272 chkconfig --add does not add the init script to the appropriate run levels
Submitted: 11 Apr 2003 3:31 Modified: 4 Jun 2003 8:50
Reporter: Lenz Grimmer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:all OS:Linux (Red Hat Linux)
Assigned to: Lenz Grimmer CPU Architecture:Any

[11 Apr 2003 3:31] Lenz Grimmer
Description:
When installing the MySQL RPMs, the mysql init script is not being activated in the appropriate 
run levels. Instead of the required run levels 2-5, chkconfig only adds it to run level 2 and 4 
instead. Some investigation revealed, that it seems to be a bug in chkconfig - it gets confused 
when an init script includes both chkconfig and LSB style header information. 
 
A bug report was filed with Red Hat's Bugzilla Database: 
 
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=88602 
 
As a workaround, one can activate the init script manually by running the following command 
after installing the MySQL RPM: 
 
chkconfig  --level 2345 mysql on 

How to repeat:
[23 Apr 2003 3:37] Lenz Grimmer
I suspend this bug for the time being
[2 Jun 2003 17:59] [ name withheld ]
While I wasn't sure of the proper format for the LSB init script section, it looks like the problem 
described is a result of bad configuration.  To get the same result as when only the chkconfig 
comments are included in the file, apply the following diff:

*** /usr/share/mysql/mysql.server       Thu Jan 23 08:08:39 2003
--- mysql       Mon Jun  2 18:10:34 2003
***************
*** 18,25 ****
  # 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 MySQL
  # Description: MySQL is a very fast and reliable SQL database engine.
  ### END INIT INFO
--- 18,25 ----
  # Provides: mysql
  # Required-Start: $local_fs $network $remote_fs
  # Required-Stop: $local_fs $network $remote_fs
! # Default-Start:  2 3 4 5
! # Default-Stop: 0 1 6
  # Short-Description: start and stop MySQL
  # Description: MySQL is a very fast and reliable SQL database engine.
  ### END INIT INFO

Running "chkconfig --list mysql" (note the name of my init script from the diff above) now yields:

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

This is the expected result given the default chkconfig comments in the script:

# Comments to support chkconfig on RedHat Linux
# chkconfig: 2345 90 90
# description: A very fast and reliable SQL database engine.

Alternatively, the problem may be corrected by deleting the entire LSB init script section.
[4 Jun 2003 8:50] Lenz Grimmer
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

Thanks for the suggestion - I've now updated the LSB header accordingly and it seems to work on 
both LSB and Red Hat systems. This will be fixed for the next releases of 4.0 (4.0.14) and 4.1 (4.1.1)