[CentOS] Starting tomcat on bootup

Barry Brimer barry.brimer at bigfoot.com
Wed May 3 03:14:57 UTC 2006


> I just installed Tomcat and when I run the chkconfig -add tomcat, it tells
> me that tomcat does not support chkconfig.

In order to support chkconfig, an init script must:
1.  Be located in /etc/rc.d/init.d (which /etc/init.d is a symlink to)
2.  Have a commented out line that contains "chkconfig: <default runlevels 
for this service> <start priority> <stop priority>"
3.  Have a commented out line that contains "description: <a description 
of the service>"
4.  Upon successful service startup, place a lock file in /var/lock/subsys 
that matches the name of the service script.  Upon successful service 
shutdown, the lockfile must be removed.

It is worth noting that you must use "chkconfig --add <service 
name>" in order to have the service script placed in the shutdown/restart 
runlevels correctly.

There are many great examples already provided by existing services.  They 
should be fairly straightforward reading.

Best of luck,
Barry



More information about the CentOS mailing list