SystemD service reports "failed" when stopped

Environment:

  • SonarQube LTS 6.7.7
  • OpenJDK 1.8.0
  • RHEL 7.6

I’m starting SonarQube as a systemd service as outlined in https://docs.sonarqube.org/latest/setup/operate-server/. The service starts fine and seems to stop as well, but when stopped and checking status it is reported as “failed”:

[root@XXXXXXXX logs]# systemctl status sonarqube
● sonarqube.service - SonarQube service
Loaded: loaded (/etc/systemd/system/sonarqube.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/sonarqube.service.d
└─environment.conf
Active: failed (Result: exit-code) since Tue 2019-06-25 10:31:50 CEST; 2s ago
Process: 13052 ExecStart=/bin/nohup java -Xms32m -Xmx32m -Djava.net.preferIPv4Stack=true -jar /opt/sonarqube/sonarqube/lib/sonar-application-6.7.7.jar (c ode=exited, status=143)
Main PID: 13052 (code=exited, status=143)

I would appreciate any pointers how to fix this.

Hi Anders,

You’re right, when SonarQube is stopped by SIGTERM the exit code is 143.
On this case SystemD is not considering this as a normal exit code.

I’ll update the page, meanwhile you can add in [Service] section :

SuccessExitStatus=143

Cheers,

Awesome Eric, thanks!