Linux - rc.local自启动脚本

rc.local 是一个系统脚本java

该脚本是在系统初始化级别脚本运行以后再执行的,所以能够安全地在里面添加你想在系统启动以后执行的脚本。vim

查看脚本

cat /etc/rc.localtomcat

#!/bin/sh
#
# 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.

touch /var/lock/subsys/local
export JAVA_HOME="/usr/java/jdk1.7.0_79"
export CLASSPATH=".:${JAVA_HOME}/lib:${JAVA_HOME}/lib/tools.jar"
export PATH=${JAVA_HOME}/bin:$PATH
#tomcat 1
/etc/init.d/tomcat start
#tomcat 2
/opt/tomcat/bin/catalina.sh start

编辑脚本

vim /etc/rc.local安全

相关文章
相关标签/搜索