drinkits

Tēma: Bez kategorijas (1. lapa no 2)

Script to Restart JIRA automatically

I have modified Atlassian script to support following features:

  • Cleanup for leftover files – .jira-home.lock, catalina.pid
  • catalina.out log backup
  • Check for running process and force kill JIRA if don’t stop on time
#!/bin/sh -e
# JIRA startup script
# Description: For JIRA 7.2.7

# Define some variables
# Name of app ( JIRA, Confluence, etc )
APP=jira
# Name of the user to run as
USER=root
# Location of application's bin directory
BASE=/u01/jira/Prod_7.2.7
export JIRAHOME=$BASE
# Location of application's home directory
JHOME=/u01/jira/Prod_7.2.7_home
export JIRA_HOME=$JHOME
# Location of Java JDK
export JAVA_HOME=/usr/java/default

case "$1" in
  # Start command
  start)
    echo "Starting $APP"
    lockfile="$JHOME/.jira-home.lock"
    [ -e $lockfile ] && rm $lockfile

    pidfile="$BASE/work/catalina.pid"
    [ -e $pidfile ] && rm $pidfile

    logfile="$BASE/logs/catalina.out"
    [ -e $logfile ] && mv $BASE/logs/catalina.out "$BASE/logs/catalina-`date +%F`.out"

    /bin/su -m $USER -c "cd $BASE/bin && $BASE/bin/start-jira.sh &> /dev/null"
    ;;
  # Stop command
  stop)

    blah=""
    temp=`ps aux|grep java|grep jira|grep -v grep|awk '{print $2}'`
    pidfile="$BASE/work/catalina.pid"

    if [ "$temp" == "$blah" ]
    then
       echo 'JIRA is not running'
       exit 0
    fi

    echo 'Shutting down JIRA'
    /bin/su -m $USER -c "$BASE/bin/stop-jira.sh &> /dev/null"

    echo 'Sleeping 30 seconds, because sleeping is good...'
    sleep 30 

    temp=`ps aux|grep java|grep jira|grep -v grep|awk '{print $2}'`

    echo 'Now checking if JIRA is still running...'

    if [ "$temp" != "$blah" ]
    then
       echo 'Force killing JIRA now...'
       /bin/su -m $USER -c "$BASE/bin/catalina.sh stop -force $num >/dev/null 2>&1"
       echo 'Killed'
       exit 0
    else
       echo 'JIRA is already down'
       exit 0
    fi

    echo "...done"
    exit 0
    ;;
   # Restart command
   restart)
        $0 stop
        sleep 60
        $0 start
        ;;
  *)
    echo "Usage: jira {start|restart|stop}"
    exit 1
    ;;
esac

exit 0

Best Brew Challenge 2016 | #016 (Līga lullē)

Šogad apņēmos piedalīties Best Brew Challenge 2016, ko rīko Bestmalz iesalnīca. Konkursā piedalās alus brūvētāji no visas pasaules. Galvenais uzdevums ir, izmantojot Bestmalz iesalu produkciju, visiem reizē sabrūvēt alus (konkursa nolikums) un to dokumentēt video un foto formātā.

 

Rīga – Stokholma – Rīga

Filmēts ar Nokia Lumia 820. Timelapse kadri uzņemti ar Timelapse Pro programmu telefonu atstutējot pret kajītes logu.

Testēju alus

29.10.2013: Atsāku testēt alus. Termiņš nenoteikts.

http://alus.optimisti.lv/

Vēsturei

Pāris teksta blāķi, lai nepazustu:

image

Lasīt tālāk

Olderposts

Copyright © 2017 drinkits

Izstrādājis Anders NorénUz augšu ↑