Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.