Fri 21 Nov 2008
Simple Jira Init Script (Suse Linux SLES)
Posted by admin under Jira , Suse , linux , programming , shell1 Comment
Here a very simple init script tested on Suse SLES 10. An other good way to create one is looking at the init-Script for tomcat or using just it and installing Jira as WAR into tomcat.
#!/bin/bash # Jira startup script # install: # copy to /etc/init.d/jirad # ln -s /etc/init.d/jirad /sbin/rcmy-jirad # insserv /etc/init.d/jirad ### BEGIN INIT INFO # Provides: jirad # Required-Start: $local_fs $network # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: Starts Jira server # Description: Starts Jira Issue Tracking ### END INIT INFO # Based on script at http://confluence.atlassian.com/pages/viewpage.action?pageId=183148 RUN_AS_USER=jico CATALINA_HOME=/opt/jira 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 Confluence: " 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