Service stops for unknown reason? (Solved)
I just started using YouTrack and love it so far, but one major problem so far is that it stopped running overnight, and now has stopped running in the middle of the day.
I check the most recently written-to log files and see no errors. I check Windows Server Event Viewer and there is no information there either.
I am using the “zip” installation, where I run youtrack.bat start
to bring the system up. But it does not seem to run as a Windows service so it does not stay running. (A real Windows service would be restarted if it crashed.)
How can I:
- find out why it's stopping
- run it as a Windows service so that it will keep running even if it stops
(hmm, maybe I could run the “youtrack start” itself as a service…)
Thanks
Wait I think I get it… I am running it when logged into the server. So the process is launched in my windows profile. So when I logout the process ends. That explains why there is no error. Ok I will try setting up the command as a service and that should fix this issue.
Seems it's not possible to run a .bat file as a Windows service, but I ran it as a hidden startup task instead and that seems to have worked so far.
Another update: ultimately I was not really satisfied with using a scheduled task to keep the server running. Instead I wrote a simple .NET Service that wraps the youtrack start and youtrack stop calls from the service start and stop events. I'm not exactly sure how JetBrains intends for this to work; even this solution is a bit iffy since the service is still a different process than the youtrack process. (If the youtrack process stops I don't think the service would notice for example, but I could still use the service to bring it back up, and the service will otherwise keep it running after reboots etc.)
Please sign in to leave a comment.