From b7f435012837f8c2017119b9823e8566b671313c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 27 Jan 2007 00:13:46 +0000 Subject: Add check_reload_status checker script to ensure that it is always running. Prior attempts to restart from filter.inc lead to socket descriptor inheriting strangeness. --- usr/local/bin/checkreload.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 usr/local/bin/checkreload.sh (limited to 'usr/local/bin') diff --git a/usr/local/bin/checkreload.sh b/usr/local/bin/checkreload.sh new file mode 100755 index 0000000..40bde37 --- /dev/null +++ b/usr/local/bin/checkreload.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +CHECKRELOADSTATUS=`pgrep check_reload_status | grep -v grep | wc -l` +DATE=`date +%m-%d-%Y_at_%H%M%S` +OUTFILE=/root/check_reload_status.log + +if [ ${CHECKRELOADSTATUS} -lt 1 ] ; then + echo "${DATE}: Re-starting check_reload_status, it died for some reason..." >> ${OUTFILE} + /usr/local/sbin/check_reload_status +fi + +if [ ${CHECKRELOADSTATUS} -gt 1 ] ; then + echo "${DATE} There appears to be 2 or more check_reload_status processes. Forcing kill and restart of all now..." >> ${OUTFILE} + kill -9 `pgrep check_reload_status` + /usr/local/sbin/check_reload_status +fi -- cgit v1.1