1
votes

I'm new to Linux Servers and I setup a VM to be used as a Sonarqube instance for our dev team . Everything works fine except the sonarqube service that I setup using systemctl . It gives the error as follows . However when I run the sh script Sonarqube starts up just fine .

● sonarqube.service - SonarQube service Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2020-11-11 13:14:12 UTC; 1min 46s ago Process: 1091 ExecStart=/usr/bin/nohup /usr/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /opt/sonarqube/lib/sonar-application-8.1.0.31237.jar (code=exite Main PID: 1091 (code=exited, status=1/FAILURE)

Nov 11 13:14:11 recommendesonarqubeserver systemd[1]: sonarqube.service: Main process exited, code=exited, status=1/FAILURE Nov 11 13:14:11 recommendesonarqubeserver systemd[1]: sonarqube.service: Failed with result 'exit-code'. Nov 11 13:14:12 recommendesonarqubeserver systemd[1]: sonarqube.service: Service hold-off time over, scheduling restart. Nov 11 13:14:12 recommendesonarqubeserver systemd[1]: sonarqube.service: Scheduled restart job, restart counter is at 5. Nov 11 13:14:12 recommendesonarqubeserver systemd[1]: Stopped SonarQube service. Nov 11 13:14:12 recommendesonarqubeserver systemd[1]: sonarqube.service: Start request repeated too quickly. Nov 11 13:14:12 recommendesonarqubeserver systemd[1]: sonarqube.service: Failed with result 'exit-code'. Nov 11 13:14:12 recommendesonarqubeserver systemd[1]: Failed to start SonarQube service.

1

1 Answers

1
votes

To start SonarQube as a service, you need to have a dedicated sonarqube user say sonar. This sonar user should own all the configuration files and other executables.

You can start the systemd service using this particular user sonar

Please refer to this post for more information:

SonarQube 7.2 won't start with systemd on CentOS 7