all you have to do is to lookup into the start/stop scripts of all the applications i.e. MySQL, Tomcat, which in my case(i use CentOS 5.3) are present in /etc/init.d, lets say you want to set boot priority for MySQL, then you have to edit the file
Code:
# vi /etc/init.d/mysqld
which is the start/stop file for MySQL, you have to find start/stop files for Java and Tomcat similarly in /etc/init.d directory, make sure that you backup the original file somewhere before you edit it,
Now The first few lines of mysqld will be like
Code:
#!/bin/bash
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: 345 64 36
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid
Now the line
Code:
# chkconfig: 345 64 36
states that, MySQL will run on runlevels 3,4 and 5, and the boot priority for starting up is 64, and for stopping is 36. Now if you want Tomcat to start after the Mysql, you can set the line in Tomcat start/stop script as
Code:
# chkconfig: 345 65 35
this will start Tomcat immediately after MySQL and stop it just before stopping MySQL. Save and exit the files and then make sure they are started at boot time by typing the commands
Code:
# chkconfig --add mysqld
# chkconfig --add tomcat
hope that you have got the idea