Auto start/restart Mango (daemonise)?
What methods are others using to auto start and auto restart (on process exit) their Mango installations?
I guess there are various ways to do it (depending on your environment and preference) but it would be great to hear from other Mango users about what they do, what works, what didn't etc.
Even better would be to share some scripts/methods.
There are some good hints in this thread on StackOverflow: http://stackoverflow.com/questions/525247/how-do-i-daemonize-an-arbitrary-script-in-unix
There was some discussion of this topic in this thread: http://forum.infiniteautomation.com/forum/posts/list/1408.page
That post seems to be missing now and I was just looking for the same thing. I assume the best, or only?, way is through CRON on the system itself?
Alas I can't recall what thread I was linking.
Having a watchdog you've written into a cron is an option, for sure.
I believe Jeremy was asking about how to make a service definition that handles the restarting, which will depend on your service daemon. I can try to assist with looking into a particular daemon, if requested.
About the easiest, platform-independent way to get a Mango to restart if something gets bad is to put a process event handler on the System Startup event to
touch /path/to/Mango/RESTARTwhich will use the mechanisms in the startup scripts to restart Mango. This will fail if the startup fails, but so would any other restart method. Using this you could get a rudimentary persistence by simply adding the launch command into your rc.local. This would cause your Mango to restart if you issued an ./ma.sh stop, as well, or a kill -9 to Java, etc. You would have to kill the ma-start.sh script to kill the restarting.
Other than that, it'll be service definitions I would advise for starting / restarting Mango.