Matt
Owner
Matt submitted a new resource:
Service Monitor and Restart Script - Monitor and Restart Processes
Read more about this resource...
Service Monitor and Restart Script - Monitor and Restart Processes
Create a new file called process.txt in the /root/scripts folder (you might need to also make the /root/scripts folder)
Get a list of the processes you want to monitor from the ps -ef output
and add them to this file.Bash:/usr/sbin/mysqld /usr/bin/memcached /usr/libexec/postfix/master /bin/java
Code:#!/bin/bash echo "Checking all processes are running...."; for i in `/bin/cat /root/scripts/process.txt` do if [ $(ps aux | grep -e "$i" | grep -v grep | wc...
Read more about this resource...