SonarQube-Centos环境设置为系统服务

1.准备工作

官方文档:https://docs.sonarqube.org/latest/setup/operate-server/

2.配置

ln -s /home/sonar/sonarqube/bin/linux-x86-64/sonar.sh /usr/bin/sonar
cd /etc/init.d/
vim sonar
#sonar
-service 脚本 #!/bin/sh # # rc file for SonarQube # # chkconfig: 345 96 10 # description: SonarQube system (www.sonarsource.org) # ### BEGIN INIT INFO # Provides: sonar # Required-Start: $network # Required-Stop: $network # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: SonarQube system (www.sonarsource.org) # Description: SonarQube system (www.sonarsource.org) ### END INIT INFO /usr/bin/sonar $*

 

3.添加系统服务

sudo chmod 755 /etc/init.d/sonar
sudo chkconfig --add sonar

4.验证

[sonar@xxxxxx ~]$ service sonar status
SonarQube is running (31746).

 

posted @ 2018-11-15 15:17  Zeyangli  阅读(552)  评论(0编辑  收藏  举报