Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Auto start/restart Mango (daemonise)?


  • Hi

    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

    Cheers
    Jeremy


  • 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/RESTART which 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.