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. --- etc/crontab | 1 + usr/local/bin/checkreload.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100755 usr/local/bin/checkreload.sh diff --git a/etc/crontab b/etc/crontab index 9cd5032..8f19fcd 100644 --- a/etc/crontab +++ b/etc/crontab @@ -11,3 +11,4 @@ HOME=/var/log */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 virusprot */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -t 1800 snort2c */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -t 1800 snort2c +*/5 * * * * root /usr/local/bin/checkreload.sh \ No newline at end of file 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