Skip to content

create jira shell script

July 25, 2011

Hi Guys

in this session,. i’ll show to you how to create a shell script for start/stop/restart jira

create shell script

# nano /path_yours/jira.sh

and enter this line

 #!/bin/bash
 # JIRA startup script
 # chkconfig: 2345 64 36
 # description: A really sweet issue tracker from Atlassian
JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.20"
 JRE_HOME="/usr/lib/jvm/java-6-sun-1.6.0.20"
 RUN_AS_USER=root
 CATALINA_HOME=/atlassian-jira-4.3.4-standalone
start() {
 echo "Starting JIRA: "
 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."
 }
 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

go to your path and then execute the line

./jira.sh start
Advertisements

From → Misc., Ubuntu

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: