I am having an Ubuntu box on which I am having a Haskell process (think of it as a random server process) that I built. I want to start it on boot and restart it in case it fails for whatever reason (ideally with some kind of logging that it failed, what exec code it failed with, etc.).
How to do that?
Right now I wrote a shell script which is located in /etc/init.d/ which will fire up the haskell process and pipes it output to /var/log/.log . How to do the monitoring/restarting though?