Re: Starting squid via inittab

From: Tilman Schmidt <Tilman.Schmidt@dont-contact.us>
Date: Mon, 27 Sep 1999 08:44:45 +0200

At 04:43 25.09.99 -0400, Gerry George wrote:
>I am running squid (2.2.STABLE1) on Red Hat Linux 6.0 (2.2.5-15). I am
>trying to have squid start from inittab, since I have noticed that it will
>occasionally die. In such a case, I want it to automatically restart.

I don't think starting Squid from inittab is a good idea. Squid 2
restarts itself automatically if it dies all by its own. I am starting
Squid 2.2STABLE4 on a SuSE Linux with the attached /sbin/init.d/squid
script, and never had any problems.

> I have followed the instructions as per
>http://squid.nlanr.net/Doc/FAQ/FAQ-3.html#ss3.6.

That section looks like a leftover from Squid version 1 to me. IMHO
the reference to inittab should be removed completely. The RunCache
script and the recommendation to use nohup are obsolete too, AFAIK.

-------- /sbin/init.d/squid --------
#!/bin/sh
#
# Start/stop Squid HTTP proxy server.
#

. /etc/rc.config
test "$START_SQUID" = yes || exit 0

case "$1" in

'start')
        if [ -x /usr/local/squid/bin/squid ]; then
                echo "Starting Squid HTTP proxy/cache."
                /usr/local/squid/bin/squid || exit 1
        fi
        ;;

'stop')
        echo "Shutting down Squid HTTP proxy/cache."
        /usr/local/squid/bin/squid -k shutdown

        countdown=30
        while /usr/local/squid/bin/squid -k check 2> /dev/null && [ $countdown -gt 0 ]
        do
                echo -ne "Waiting $countdown seconds for squid process to terminate...\r"
                sleep 1
                countdown=`expr $countdown - 1`
        done
        if [ $countdown -gt 0 ]
        then
                echo -e "\nSquid terminated."
        else
                echo -e "\nGiving up."
        fi
        ;;

'reload')
        echo "Reconfiguring Squid HTTP proxy/cache."
        /usr/local/squid/bin/squid -k reconfigure
        ;;

*)
        echo "Usage: $0 { start | stop | reload }"
        exit 1
        ;;

esac
exit 0

-- 
Tilman Schmidt          E-Mail: Tilman.Schmidt@sema.de (office)
Sema Group Koeln, Germany       tilman@schmidt.bn.uunet.de (private)
Received on Mon Sep 27 1999 - 00:55:59 MDT

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