我只是想知道在 OSX 上自动启动和关闭 (独立) JIRA 安装的正确方法是什么 (分别在开机和关机时)?希望避免手动编辑 OSX 启动脚本,但如果这是正确或唯一的方法,我愿意这样做。
答案1
你可能想运行一下launchctl
:https://developer.apple.com/library/mac/#documentation/darwin/reference/manpages/man1/launchctl.1.html
您可以编写一个简单的脚本并让它在启动时启动$HOME/.launchd.conf
以下是来自 JIRA 的一些文档:http://confluence.atlassian.com/display/JIRA044/Configure+JIRA+as+service+on+Mac+OS+X
以下是示例脚本:
#!/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