OS: Centos 5.7
My application script starts like this (/etc/init.d/myapp):
#!/bin/sh # chkconfig 2345 85 60 # description: my application controller # processname: myapp NAME=MyApp DIR=/opt/myapp/ RUN_AS=root ### BEGIN INIT INFO # Provides: myapp # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Starts the myapp application ### END INIT INFO
chkconfig --list | grep myapp myapp 0:off 1:off 2:on 3:on 4:on 5:on 6:off
myapp accepts start | stop | restart | force-reload and they're all tested to work
myapp controller basically needs to start some daemon services for the application. If I run
service myapp start after the system is rebooted, everything works fine. But for some reason, chkconfig is not starting it up automatically. Can anyone explain what I may be doing wrong?
Thanks to cjc's information, it appears that my application controller is loading prior to some required services such as mysql.
Here's the result of a quick search:
find /etc -name rc* -type d | xargs ls | grep myapp K50myapp K50myapp S50myapp S50myapp S50myapp S50myapp K50myapp
So why is the order set to 50 when in the script I've set to 85(start) 60(stop)? And how can I change this?
Solution (as pointed out by cjc in comments to his answer)
# chkconfig 2345 85 60
Correct to (colon needed after chkconfig):
# chkconfig: 2345 85 60