I have tomcat8 intalled on my Amazon Linux AMI, I modified the tomcat8 init script header, so chkconfig could install tomcat8 to run automatically on boot. The modified header is:
#!/bin/bash
#
# tomcat This shell script takes care of starting and stopping Tomcat
#
# chkconfig: 345 80 20
# description: Release implementation for Servlet 3.0 and JSP 2.2
### BEGIN INIT INFO
# Provides: tomcat
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Description: Release implementation for Servlet 3.0 and JSP 2.2
# Short-Description: start and stop tomcat
### END INIT INFO
#
# - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot
# - heavily rewritten by Deepak Bhole and Jason Corley
#
I as you can see I set it to run on runlevels 3, 4, and 5.
Then I runned:
sudo chkconfig --add tomcat8
And to my dispair after running the --list
option, tomcat8 is off
for all runlevels:
$ sudo chkconfig --add tomcat8
$ chkconfig --list tomcat8
tomcat8 0:off 1:off 2:off 3:off 4:off 5:off 6:off
What's going on? What am I missing? Why isn't chkconfig turning tomcat8 on
on levels 3, 4 and 5?