Description of problem: chkconfig LSB processing is truly brittle. I have a case where I get different results with two init scripts that only differ in the presence of a single comment line. If the comment line is removed, start/stop sequences are correct if it is present chkconfig comes up with to S99/K01 levels. So here is the start of the script I was writing. #!/bin/sh # # myservice - Illustrates a bug in chkconfig # # /etc/rc.d/init.d/myservice # # chkconfig: 345 58 22 # description: Bug reporting # ### BEGIN INIT INFO # Provides: feedback # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Required-Start: $network # Required-Stop: $network # Description: none If the "### BEGIN INIT INFO" line is present then I get S99/K01 links # grep BEGIN /etc/rc.d/init.d/myservice; echo; chkconfig --del myservice; chkconfig --add myservice; find /etc/rc.d/ -name \*myservice ### BEGIN INIT INFO /etc/rc.d/rc5.d/S99myservice /etc/rc.d/rc3.d/S99myservice /etc/rc.d/rc6.d/K01myservice /etc/rc.d/rc2.d/K01myservice /etc/rc.d/rc0.d/K01myservice /etc/rc.d/rc1.d/K01myservice /etc/rc.d/rc4.d/S99myservice /etc/rc.d/init.d/myservice If I remove it, the links are as expected grep BEGIN /etc/rc.d/init.d/myservice; echo; chkconfig --del myservice; chkconfig --add myservice; find /etc/rc.d/ -name \*myservice /etc/rc.d/rc5.d/S58myservice /etc/rc.d/rc3.d/S58myservice /etc/rc.d/rc6.d/K22myservice /etc/rc.d/rc2.d/K22myservice /etc/rc.d/rc0.d/K22myservice /etc/rc.d/rc1.d/K22myservice /etc/rc.d/rc4.d/S58myservice /etc/rc.d/init.d/myservice Part of the problem is the "$network" dependency which in RHEL 4.5 can be multiply defined by the network and NetworkManager rc scripts # grep Provides: /etc/rc.d/init.d/* | grep network /etc/rc.d/init.d/NetworkManager:# Provides: $network /etc/rc.d/init.d/network:# Provides: $network If I remove the NetworkManager package, then chkconfig always gives the right start/stop levels even if the troublesome comment line is present. I've checked the chkconfig released with Fedora 7 (1.3.34) as well and found processing is still broken with that version. Version-Release number of selected component (if applicable): RHEL 4.5 AS The packages installed currently are: initscripts-7.93.25.EL-1 NetworkManager-0.3.1-3 chkconfig-1.3.13.4-1 How reproducible: 100% Steps to Reproduce: 1. Install NetworkManager and initscripts RPMS so that the $network dependency is multiply defined. 2. Create a startup script with chkconfig comments as listed above 3. chkconfig delete and add the service and check the symlinks created. Actual results: see above Expected results: see above Additional info:
This is the intended behavior. 1) ### BEGIN INIT INFO implies you want to set priorities via LSB dependencies 2) $network is/was provided by NetworkManager, so that affects where your script is ordered. This is actually changed in later NetworkManager releases.