centos下實現程式開機自啟動(tomcat為例)

不淨之心發表於2013-03-27
[url]http://blog.csdn.net/fjssharpsword/article/details/7436898[/url]

[b]vim /etc/rc.d/rc.local [/b]
開啟後用下文覆蓋即可
--------------------------------------------------------------------------------------------------------------------------------
[color=blue]# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
export JAVA_HOME=/home/hostname/jdk1.6.0_31
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export CATALINA_HOME=/home/hostname/apache-tomcat-6.0.35
#tomcat自啟動
/home/hostname/apache-tomcat-6.0.35/bin/startup.sh
#其他程式自啟動例子
/usr/bin/程式名
touch /var/lock/subsys/local[/color]

-----------------------------------------------------------------------------------------------------------------------------------

相關文章