JIRA init.d Skrip zum starten auf ein Linux System (debian, Ubuntu 9.10)

FAQ JIRA

Anbei ein init.d Skript für das automatische starten von JIRA

 

#!/bin/bash
# JIRA startup script

# Based on script at http://www.bifrost.org/problems.html
### BEGIN INIT INFO
# Provides:          atlassian-jira
# Required-Start:    $syslog
# Should-Start:
# Required-Stop:     $syslog
# Should-Stop:
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Atlassian JIRA - The Enterprise Issue Tracking System
# Description:       @8087 Starts JIRA Enterprise
### END INIT INFO

RUN_AS_USER=jira
CATALINA_HOME=/home/atlassian/jira

start() {
        echo "Starting JIRA: "
        chmod 777 /home/atlassian/jira/logs/catalina.out
        if [ "x$USER" != "x$RUN_AS_USER" ]; then
          su - $RUN_AS_USER -c "$CATALINA_HOME/bin/startup.sh"
        else
          $CATALINA_HOME/bin/startup.sh
        fi
        echo "done."
        #tail -f "$CATALINA_HOME/logs/catalina.out" &
}
stop() {
        echo "Shutting down JIRA: "
        if [ "x$USER" != "x$RUN_AS_USER" ]; then
          su - $RUN_AS_USER -c "$CATALINA_HOME/bin/shutdown.sh"
        else
          $CATALINA_HOME/bin/shutdown.sh
        fi
        echo "done."
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        sleep 10
        #echo "Hard killing any remaining threads.."
        #kill -9 `cat $CATALINA_HOME/work/catalina.pid`
        start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
esac

exit 0

Ensuring Jira is started at boot time:

  1. Make sure the jira script is executable by running the command:
    sudo chmod +x /etc/init.d/jira
  2. Add the jira start up script to the required run levels by running the command:
    sudo update-rc.d jira defaults 8087 (as in this example above, usually)
    sudo update-rc.d jira defaults 80
  3. Start Jira now using the command:
    sudo /etc/init.d/jira start

To be completely sure that it has worked, reboot your server and try accessing Jira using your web browser by going to http://localhost:8087/ Hopefully, Jira will have auto started.