Failed to start sonar.service
sonar.service file content
Hi @pankajdevrani ,
your systemd service description is not correct. did you already check out our documentation how to run sonarqube with systemd?
also what OS and systemd version are you using?
@Tobias_Trabelsi I did check out the document. Not helpful. I am trying to connect with sonarqube technical team but I don’t know why sonar team doesn’t do that. I have been facing multiple issues and your docs don’t help in that at all. And its frustrating.
FYI here I have installed sonar-developer instance
If you did then why does your service file is not using the suggested entry point?
as you can clearly see from our documentation we recommend using the jar directly:
[Unit]
Description=SonarQube service
After=syslog.target network.target
[Service]
Type=simple
User=sonarqube
Group=sonarqube
PermissionsStartOnly=true
ExecStart=/bin/nohup /opt/java/bin/java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /opt/sonarqube/lib/sonar-application-<YOUR SONARQUBE VERSION>.jar
StandardOutput=syslog
LimitNOFILE=131072
LimitNPROC=8192
TimeoutStartSec=5
Restart=always
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
keep in mind that you will need to reload the service definitions for systemd in order to let changes be reflected:
sudo systemctl daemon-reload
not sure what you mean here, but if you have purchased enterprise support then you should open a support case if you are facing issues. this is a community forum where users help other users and some employees from sonarsource (like myself) try to help voluntarily
@Tobias_Trabelsi
My sonar.service file now(I think the earlier issue was with the wrong group name)
but now I am getting the below error message with status=127/n/a
Okay now we’re getting somewhere.
exit code 127 means that the system could not find the requested executable (could be /bin/nohup
, /opt/java/bin/java
or the sonar-application.jar
). can you validate that the pathes in your service description are correct and sonarqube is starting when you run the parameters of ExecStart
manually?
@Tobias_Trabelsi /bin/nohup and /opt/java/bin/java directories do not exists in my machine.
I did install java with below command.
sudo apt-get update && sudo apt-get install openjdk-11-jdk
Then you need to adapt these pathes in your systemd service. you can get the correct pathes to the executables using the which
command as in which nohup
and which java
.
I think you are on ubuntu 20.04 so it should be:
/usr/bin/nohup
/usr/lib/jvm/java-11-openjdk-amd64/bin/java
(following symlinks)EDIT: and of cause run sudo systemctl daemon-reload
after the modification of your service file
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.