Tomcat の自動起動
以下の内容で /etc/init.d/tomcat を作成する.
#!/bin/sh # # chkconfig: - 86 14 # description: Tomcat auto start . /etc/rc.d/init.d/functions export JAVA_HOME=/usr/java/jdk1.6.0_10 ## 環境に合わせて修正 export CATALINA_HOME=/usr/local/tomcat ## 環境に合わせて修正 case "$1" in start) echo -n "starting tomcat: " ${CATALINA_HOME}/bin/startup.sh ;; stop) echo -n "shutting down tomcat: " ${CATALINA_HOME}/bin/shutdown.sh ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac exit 0
このファイルに権限と chkconfig の設定を行う.
# cd /etc/init.d # chmod 755 tomcat # chkconfig --add tomcat # chkconfig --level 2345 tomcat on # chkconfig --list tomcat #指定のレベルが on になっていればOK.