Wednesday, January 26, 2011

Jira not starting after a server reboot

Had this problem, service dependencies fixed it. Here is the link to the article with the magic...

link

Of course, that article is now gone, but here is the updated gist of it:


I have followed the article Running JIRA Standalone as a Service - which includes mention of adding a dependency.
Other dependencies which already existed were:
  • Ancillary Function Driver for Winsock
  • TCP/IP Protocol Driver
For others reading this, be careful as setting the dependency from the CMD line overwrites all existing dependencies, so you must specify existing dependencies as well.
An example to add the MS SQL Server service as a dependency and retain the existing dependencies which should already exist is:
sc config JIRA0123456789 depend= MSSQLSERVER/Tcpip/Afd

Also, there may be a lock file (... .lock) that may need to be deleted...

Finally, a script similar to the following running on startup may help with the lock file issue.  The location and name of the file needs to be confirmed.  On our system, the file is called:


.jira-home.lock


and is located in:


D:\Jira41

The script runs on start up and is as follows:
cls
:: this script will remove the lockfile after a reboot; there is a bug in jira 4.0.1 on virtual servers that shut down quicker than regular servers
:: michael trengrove
@echo off
if not exist "C:\Program Files\Atlassian\Application Data\JIRA\.jira-home.lock" (GOTO END) else (net stop "Atlassian JIRA 4.0.1")
:: wait 1 minute for Jira to fully shutdown
PING -n 60 127.0.0.1>nul
if not exist "C:\Program Files\Atlassian\Application Data\JIRA\.jira-home.lock" (GOTO start-jira) else (del "C:\Program Files\Atlassian\Application Data\JIRA\.jira-home.lock")
::wait 10 seconds to restart Jira
PING -n 10 127.0.0.1>nul
:start-jira
net start "Atlassian JIRA 4.0.1"
PING -n 20 127.0.0.1>nul
if exist "C:\Program Files\Atlassian\Application Data\JIRA\.jira-home.lock" (GOTO END) else (goto start-jira)
:END
cls

No comments: