1.create a script which calls your applications actual start and stop script. Save the script under /etc/init.d as execuatble file. You can use the example content als start point.
#!/bin/sh## rc file for SonarQube## chkconfig: 345 96 10# description: SonarQube system (www.sonarsource.org)#### BEGIN INIT INFO# Provides: sonar# Required-Start: $network# Required-Stop: $network# Default-Start: 3 4 5# Default-Stop: 0 1 2 6# Short-Description: SonarQube system (www.sonarsource.org)# Description: SonarQube system (www.sonarsource.org)### END INIT INFO/usr/bin/sonar $* 2-a. Debian based linux distros such as ubuntu registers applications with "update-rc.d". We should create a symbolik link under "/user/bin" with name "sonar". /usr/bin is by default added to the PATH. So by reboot is it easy starting the application by typing only command "sonar".
sudo ln -s $SONAR_HOME/bin/linux-x86-32/sonar.sh /usr/bin/sonarsudo chmod 755 /etc/init.d/sonarsudo update-rc.d sonar defaults 2-b Registering service on boot time for RedHat, CentOS, 64 bit based linux distro's
sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonarsudo chmod 755 /etc/init.d/sonarsudo chkconfig --add sonar
Hiç yorum yok:
Yorum Gönder