restart program when it crashes / closes by self

Hi i am wanting to restart a program which i need to have it run 24/7 the app is minergate.

The issue I am having is that the app / program feezes and shuts down - this is a known issue with the 8.1 version.

However until 8.2 comes out I have no other option but to bite my lips and bear it. I am wondering is there away to listen for the program, and if it crashes to restart the app and continue the ETH mining?


You can run the program as a daemon using the daemon command, which runs the program in the background, and will automatically restart it if it dies (using the --respawn option) :

daemon --name="yourservicename" --respawn --output=yourlog.txt yourprogram

To stop the daemon:

daemon --name="yourservicename" --stop

To install daemon:

sudo apt-get update
sudo apt-get install daemon