Re: How to start squid?

From: Peter Hartley <[email protected]>
Date: Tue, 10 Sep 1996 06:42:51 -0400

At 12:31 PM 10-09-96 +0200, Markus Wirtz wrote:
>Hi,
>
>I am thinking about the best and most secure way to start squid.
>This time, I start it from a script that is invoked once at boot time, but
>that does not satisfy me. Because if due to any circumstance stopping squid,
>it is never re-started. How can I manage to be sure squid is always up?
>
Here is my solution that runs once a minute from crontab.
I am sure eventually things will get more stable but my
alpha16 version manages about 90 minutes between crashes
on average and 3-4 minutes when it's feeling poorly... :-)

- - - - - - - - - - - - start - - - - - - - - -
rm -f /squid.core
# because when the rotten thing crashes it leaves its
# core dump in my root directory which isn't very big
# and I think this is very rude of it!!!!!!!!!
#
q=`ps -axww|grep squid|grep -v grep|grep -v tail|wc -l`
# count the processes
z=`/bin/expr 0 + 0`
a=`/bin/expr 1 + 1`
q=`/bin/expr "$q" \| "$z"`
r=`/bin/expr $z + $q`
# create some numbers
# not elegant but it works
# now test things
if [ $r -eq $z ]
then
# mail the boss
/usr/bin/mail -s "Squid restarted at `date`" headhoncho < /dev/null
# restart it
/usr/contrib/bin/daemon /usr/contrib/bin/squid -s
fi

Hope that helps some of you folks...
Peter Hartley
for "Hartley's" > http://www.hartley.on.ca
Contributing to the 'net with...
Hot Bots > http://infobot.hartley.on.ca/infobot.html
2SPAM or not2SPAM > http://www.hartley.on.ca/dspam.html
EZBiz home biz > http://ezbiz.hartley.on.ca/ezbiz.html
Received on Tue Sep 10 1996 - 03:44:51 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:32:58 MST