I'm using Upstart on Ubuntu 12.04 to control and monitor a service defined by me, where the service is a user process running as a daemon. I need to monitor it so, when it fails/crashes it respawns, if it needs to start another processes the upstart scripts do it on the fly with the available stanzas. Until there so far, I hace managed it to work, but now I need to reboot system if the desired process, if tried to respawn "n" number of times and failed, cannot start again.
How can I accomplish this? Can I do it using Upstart as well or maybe I need to include another kind of script or daemon?
Any help will be appreciated. PD.- By the way, can I change how many respawns will Upstart waits till reboot?