1

Just wondering what the proper OSX way to start up and shut down a (standalone) JIRA installation on automatically (on power on and shutdown respectively) would be please? Would prefer to avoid editing OSX startup scripts manually, but willing to do it if it's the proper or only way.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
Prembo
  • 927
  • 1
  • 6
  • 11

1 Answers1

1

You'll probably want to run it through launchctl: https://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man1/launchctl.1.html

You could write a simple script and have it launch on start $HOME/.launchd.conf

Here's some documentation from JIRA: http://confluence.atlassian.com/display/JIRA044/Configure+JIRA+as+service+on+Mac+OS+X

And here's an example script:

#!/bin/bash
function shutdown()
{
    date
    echo "Shutting down JIRA"
    $JIRA_HOME/bin/stop-jira.sh
}

date
echo "Starting JIRA"
export JIRA_PID=/tmp/$$

# Uncomment to increase Tomcat's maximum heap allocation
# export JAVA_OPTS=-Xmx512M $JAVA_OPTS

. $JIRA_HOME/bin/start-jira.sh

# Allow any signal that would kill a process to stop Tomcat
trap shutdown HUP INT QUIT ABRT KILL ALRM TERM TSTP

echo "Waiting for `cat $JIRA_PID`"
wait `cat $JIRA_PID
Randall Hunt
  • 125
  • 6