My JIRA server occasionally dies. I've not been able to find any 'out of memory' errors, or anything else in the logs that would explain this. So I give up and do the following little script:
#/bin/sh
#### script to check every ten minutes if JIRA is up and restart it if it isn't
mailPerson="jiraadmin@mydomain.com
statusFile="/tmp/status"
/bin/ps -ef |/bin/grep -q jira
lastStatus=$?
if [ $lastStatus != "0" ]; then
/etc/init.d/jira start
statusStatus="The JIRA service was down"
/bin/cat << EOF > $statusFile
I have just had to restart JIRA!!
EOF
/bin/cat $statusFile | mail -s "$statusStatus" $mailPerson
fi
exit 0I set this in root's cron, and set it for every ten minutes.
In a nutshell: it doesn't work.
The same script is running for Confluence (with the ps suitably altered), and that doesn't work either.
Ideas ?