diff options
author | stevan-vanderwerf-sonarsource <97156518+stevan-vanderwerf-sonarsource@users.noreply.github.com> | 2022-10-10 08:39:17 -0500 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-10-10 20:03:09 +0000 |
commit | dfbcf8829fbc9de19c0e21cef873fcb545227c77 (patch) | |
tree | d06f94f03587c3871e41270f61865159997ad0de /server/sonar-docs | |
parent | 00dda5a5d8089e9ff7f8c4d011a16f425cd6bf7b (diff) | |
download | sonarqube-dfbcf8829fbc9de19c0e21cef873fcb545227c77.tar.gz sonarqube-dfbcf8829fbc9de19c0e21cef873fcb545227c77.zip |
DOCS update Running SonarQube as a Service on Linux with initd section (#6775)
* DOCS update running SQ as service with initd
* DOCS align running SQ as service initd w/ systemd
Diffstat (limited to 'server/sonar-docs')
-rw-r--r-- | server/sonar-docs/src/pages/setup/operate-server.md | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/server/sonar-docs/src/pages/setup/operate-server.md b/server/sonar-docs/src/pages/setup/operate-server.md index 9accf9d85db..33a14b4ba7e 100644 --- a/server/sonar-docs/src/pages/setup/operate-server.md +++ b/server/sonar-docs/src/pages/setup/operate-server.md @@ -46,7 +46,7 @@ $SONAR_HOME/bin/linux-x86-64/sonar.sh force-stop ## Running SonarQube as a Service on Linux with SystemD -On a Unix system using SystemD, you can install SonarQube as a service. You cannot run SonarQube as `root` in 'nix systems. Ideally, you will created a new account dedicated to the purpose of running SonarQube. +On a Unix system using SystemD, you can install SonarQube as a service. You cannot run SonarQube as `root` in 'nix systems. Ideally, you will have created a new account dedicated to the purpose of running SonarQube. Let's suppose: * The user used to start the service is `sonarqube` @@ -89,9 +89,9 @@ sudo systemctl start sonarqube.service ## Running SonarQube as a Service on Linux with initd -The following has been tested on Ubuntu 8.10 and CentOS 6.2. +The following has been tested on Ubuntu 20.04 and CentOS 6.2. -Create the file /etc/init.d/sonar with this content: +You cannot run SonarQube as `root` in 'nix systems. Ideally, you will have created a new account dedicated to the purpose of running SonarQube. Let's suppose the user used to start the service is `sonarqube`. Then create the file `/etc/init.d/sonar` _based on_ the following: ``` #!/bin/sh @@ -110,8 +110,8 @@ Create the file /etc/init.d/sonar with this content: # Short-Description: SonarQube system (www.sonarsource.org) # Description: SonarQube system (www.sonarsource.org) ### END INIT INFO - -/usr/bin/sonar $* + +su sonarqube -c "/usr/bin/sonar $*" ``` Register SonarQube at boot time (RedHat, CentOS, 64 bit): @@ -121,6 +121,13 @@ sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar sudo chmod 755 /etc/init.d/sonar sudo chkconfig --add sonar ``` +Register SonarQube at boot time (Ubuntu, 64 bit): + +``` +sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar +sudo chmod 755 /etc/init.d/sonar +sudo update-rc.d sonar defaults +``` Once registration is done, run: ``` sudo service sonar start |