一、编写jenkins开机自启动脚本
vim /etc/rc.d/init.d/jenkins.sh
#!/bin/bash export JAVA_HOME=/usr/lib/jvm/java export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH cd /home/xindun/jenkins nohup java -jar jenkins.war > jenkins.log 2>&1 &
二、在/etc/rc.d/rc.local中添加以下语句
vim /etc/rc.d/rc.local
sh /etc/rc.d/init.d/jenkins.sh
三、设置可执行权限
chmod +x /etc/init.d/jenkins.sh chmod +x /etc/rc.d/rc.local
标签:JAVA,Linux,rc,jar,etc,export,HOME,自启动,jenkins From: https://www.cnblogs.com/liaozk/p/16831085.html