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).
关注公众号
![微信公众号](https://raw.githubusercontent.com/zeyangli/Jenkins-docs/master/chapter/static/image/qrcode_for%E6%8C%81%E7%BB%AD%E9%9B%86%E6%88%90%E5%85%AC%E4%BC%97%E5%8F%B7.jpg)