Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ensure that a program is running and restart it if needed?

I developed a software (in C++) which needs to be continuously running. That basically means that it has to be restarted each time it stops.

I was thinking about using cron jobs to check every minutes if it is still alive, but there might be a cleaner way or standard way of doing this.

Thanks in advance

like image 546
Barth Avatar asked Nov 28 '22 19:11

Barth


1 Answers

Fedora and Ubuntu use upstart, which has a the ability to automatically restart your deamon if it exits.

like image 160
karunski Avatar answered Dec 05 '22 11:12

karunski