您的位置:首页 > 运维架构 > Linux

CentOS下实现程序开机自启动

2014-06-28 19:49 411 查看
CentOS下实现程序开机自启动(Tomcat为例) :

vim /etc/rc.d/rc.local

打开后用下文覆盖即可

# 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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: