create a script:
sudo nano /opt/relaunch-stopped-services.sh
service YOUR_SERVICE_NAME_HERE status | grep 'active (running)' > /dev/null 2>&1
if [ $? != 0 ]
sudo service YOUR_SERVICE_NAME_HERE restart > /dev/null
make it executable:
sudo chmod +x /opt/relaunch-stopped-services.sh
You need to edit your root crontab list
sudo crontab -e and not your user profile crontab.
*/5 * * * * /opt/relaunch-stopped-services.sh > /dev/null 2>
This script will run every 5 minutes.
Full details: https://zeropointdevelopment.com/how-to-use-a-bash-script-to-restart-linux-server-services/
*if the post above has answered the question, please mark the topic as solved.
**All "answers" and responses are offered "as is" and my opinion. There is no implied support or guarantee by the ITProTV team.