Self-starting for jira and confluence

Create a JIRA startup script in the /etc/init.d/ directory #cd


/etc/ini.d/


#vim jira


#!/bin/bash
#chkconfig: 2345 85 15
# description: jira
# processname: jira


# source function library
./etc/init.d/functions #Add






the JAVA environment variable configuration also


export JAVA_HOME=/usr/local/jdk/jdk1.8.0_162
export PATH=$JAVA_HOME/bin:$PATH






#Set JIRA's working directory JIRA_HOME


JIRA_HOME=/var/jira
export JIRA_HOME #This






line is the installation path (home directory) of JIRA, mine is directly decompressed in /home/jira_workhome.
Jira=/usr/local/atlassian-jira-software-7.3.6-standalone/


startup=$Jira/bin/startup.sh


shutdown=$Jira/bin/shutdown.sh


#export JAVA_HOME=/usr/local/jdk/ jdk1.8.0_162






#After each abnormal shutdown, you need to delete the .jira-home.lock file in $Jira_Home when starting, otherwise an error will be reported when starting.


#.jira-home.lock is a lock file to keep jira safe.


#rm -rf /var/jira/.jira-home.lock




start() {
 echo -n $"Starting jira services: "


 $startup


 RETVAL=$?
 echo
}


stop() {
 echo -n $"Shutting down jira services : "


 $shutdown


 RETVAL=$?


 echo
}


case "$1" in
  start)
 start
 ;;
  stop)
 stop
 ;;
  restart|reload)
 stop
 start
 ;;
  status)
 status jira
 RETVAL=$?
 ;;
  *)
 echo $"Usage: $0 {start|stop|restart|status}"
 exit 1
esac


exit $RETVAL


needs to give executable permission to the file chmod +x /etc/init.d/confluencedAdd service
using


#chkconfig --add jira


I


The DEBIAN7 used does not have this tool. If not, install


#aptitude install chkconfig first


and then perform the previous step.


After this step is completed, you can use


#/etc/init.d/jira start/stop/restart


to start and stop the JIRA service.






Use


#chkconfig --list | grep jira to see if the JIRA service is up




You may find it is off at every level.


Start the jira service at levels 2-5 using the following command.


#chkconfig -s jira onUse #chkconfig --list | grep jira


twice to view the status of the JIRA service After the restart, the JIRA service has been started #reboot











///////////////////////////////////////////// ///////////////////////
Since confluence cannot be started automatically with rc.local, here is the start script of confluence
. Copy the following script to /etc/init.d/confluenced
# cd /etc/init.d/
# vi confluenced
Note: The following variables need to be adjusted to Confluence according to their location, JAVA_HOME


#!/bin/bash
### BEGIN INIT INFO
# chkconfig : 2345 85 15
# Provides: atlassian
# Short-Description: Start and stop the Jira&Confluence server
# Description: Start and stop the Jira&Confluence server.
### END INIT INFO
#
./etc/init.d/functions
Confluence=/root/ confluence
startup=$Confluence/bin/startup.sh
shutdown=$Confluence/bin/shutdown.sh
export JAVA_HOME=/usr/local/jdk/jdk1.8.0_162
start(){
 echo -n $"Starting Confluence"
 #daemon -c
 $startup
 RETVAL=$?
 echo
}
stop(){
 echo $"Stopping Confluence"
 $shutdown
 RETVAL=$?
 echo
}
restart(){
  stop
  start
}
status(){
        numproc=`ps -ef | grep confluence | grep -v "grep confluence" | wc -l`
        if [ $numproc -gt 0 ]; then
                echo "Confluence is running..."
        else
                echo "Confluence is stopped..."
        fi
}
# See how we were called.
case "$1" in
start)
 start
 ;;
stop)
 stop
 ;;
status)
 status
 ;;
restart)
 restart
 ;;
*)
 echo $"Usage: $0 {start|stop|status|restart}"
 exit 1
esac
exit 0
requires executable permission to the file chmod +x /etc/init.d/confluenced
# chkconfig --add confluenced
 
# chkconfig confluenced on
# service confluenced start

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324684528&siteId=291194637