From 4ee0d459c2794313454eddc9188c071dbb8bcebf Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Wed, 17 Jan 2007 13:14:18 +0000 Subject: Attempt to fix double startup error, this would result in squid starting twice and not being able to bind to the http port. --- packages/squid/proxy_monitor.sh | 4 ++-- packages/squid/squid.inc | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/squid/proxy_monitor.sh b/packages/squid/proxy_monitor.sh index 545a58da..05584534 100644 --- a/packages/squid/proxy_monitor.sh +++ b/packages/squid/proxy_monitor.sh @@ -41,7 +41,7 @@ sleep 5 # Squid monitor 1.1 while [ /bin/true ]; do if [ ! -f /var/run/squid_alarm ]; then - NUM_PROCS=`ps awux | grep "squid -D" | grep -v "grep" | wc -l | awk '{ print $1 }'` + NUM_PROCS=`ps auxw | grep "[(]squid) -D"|awk '{print $2}'| wc -l | awk '{ print $1 }'` if [ $NUM_PROCS -lt 1 ]; then # squid is down echo "Squid has exited. Reconfiguring filter." | \ @@ -54,7 +54,7 @@ while [ /bin/true ]; do touch /var/run/squid_alarm fi fi - NUM_PROCS=`ps awux | grep "squid -D" | grep -v "grep" | wc -l | awk '{ print $1 }'` + NUM_PROCS=`ps auxw | grep "[(]squid) -D"|awk '{print $2}'| wc -l | awk '{ print $1 }'` if [ $NUM_PROCS -gt 0 ]; then if [ -f /var/run/squid_alarm ]; then echo "Squid has resumed. Reconfiguring filter." | \ diff --git a/packages/squid/squid.inc b/packages/squid/squid.inc index d5f2c37d..25078785 100644 --- a/packages/squid/squid.inc +++ b/packages/squid/squid.inc @@ -173,7 +173,12 @@ function squid_install_command() { exec("/bin/rm /usr/local/etc/rc.d/squid"); $rc = array(); $rc['file'] = 'squid.sh'; - $rc['start'] = '/usr/local/sbin/squid -D'; + $rc['start'] = <</dev/null EOD; $rc['restart'] = <<