export JAVA_TOOL_OPTIONS="-Duser.timezone=Asia/Shanghai -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8"
export JENKINS_HOME=/opt/jenkinsnohup java -jar jenkins.war --httpPort=8080 >/opt/jenkins/jenkins.log 2>&1 &
su sonar /opt/sonarqube/bin/linux-x86-64/sonar.sh start
开机启动配置:
chmod +x /etc/rc.d/rc.local
修改/etc/rc.d/rc.local,在里面加上要调用的sh脚本,注意sh脚本配置chmod +x .sh
在系统启动时运行启动脚本
[root@centos ~]# cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
sh /opt/jenkins/start_jenkins.sh