Running SonarQube as a Service on Linux Documentation (CentOS 7)

The documentation Running SonarQube as a Service on Linux was last updated August 2013 (over 5 years ago) and covers CentOS 6.2 but not CentOS 7 (specifically, no mention of systemd)

I log this under “report a bug” because CentOS 6 is now in “Maintenance updates phase” (only Security errata and select mission critical bug fixes will be released).

This is what worked for me…

sonar.service file (deployed to /usr/lib/systemd/system/)

[Unit]
Description=SonarQube service
After=syslog.target network.target

[Service]
Type=forking
    
ExecStart=/opt/sonar/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonar/bin/linux-x86-64/sonar.sh stop

User=sonar
Group=sonar
Restart=always

[Install]
WantedBy=multi-user.target

Adjust ExecStart (etc) as necessary.

Then:

sudo systemctl start sonar
sudo systemctl enable sonar
1 Like

Hi,

Sorry for the slow response on this. We appreciate your feedback and plan to update the docs.

 
Ann

Hello,
It works :slight_smile: But I had to add one more line:

LimitNOFILE=65536

The final file content:

[Unit]
Description=SonarQube service
After=syslog.target network.target

[Service]
Type=forking

ExecStart=/opt/sonar/bin/linux-x86-64/sonar.sh start
ExecStop=/opt/sonar/bin/linux-x86-64/sonar.sh stop

User=sonar
Group=sonar
Restart=always
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Thanks @agabrys! We’ll update the docs.

 
Ann

Hi,

I have add the two line in the service but style have the error :

[2] bootstrap checks failed
[1]: max number of threads [2048] for user [svcpulg] is too low, increase to at least [4096]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]