Starting Sonar as a service
It is most convenient to have the Sonar server start automatically at each boot time. Thus, the final step of the setup is to have it installed as a service.
Run as a service on Linux
Create the file /etc/init.d/sonar
with the Vim or Nano editor:
sudo nano /etc/init.d/sonar
Append the following lines and save it:
#! /bin/sh /usr/bin/sonar $*
Open a terminal and enter the following commands:
sudo ln -s /home/user/development/servers/sonar-2.11/bin/linux-x86-32/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults
Reboot, open a browser, and go to http://localhost:9000/
to verify that the server is running.
Run as a service on Windows
To install or uninstall the Windows service, simply execute one of the following scripts as administrator respectively:
To install:
$ SONAR_HOME/bin/windows-x86-32/InstallNTService.bat
To uninstall:
$ SONAR_HOME/bin/windows-x86-32/UninstallNTService.bat
You can start/stop the service from Windows Services...