Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Apr 2001 10:37:29 +0100
From:      Rasputin <rara.rasputin@virgin.net>
To:        questions@freebsd.org
Subject:   Re: How on earth does Squid-2.3 init????
Message-ID:  <20010419103729.E24896@dogma.freebsd-uk.eu.org>
In-Reply-To: <20010419084858.69981.qmail@web12006.mail.yahoo.com>; from bsd2000au@yahoo.com.au on Thu, Apr 19, 2001 at 06:48:58PM %2B1000
References:  <20010419084858.69981.qmail@web12006.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii

* k s <bsd2000au@yahoo.com.au> [010419 09:50]:
> Hi all,
> Can someone please enlighten me as to how squid
> starts. It is not in rc.local. I cant find it in
> inetd.conf...hmmm.
> The reason(apart from wanting to learn something) is
> when not connected to dialup,  a squid rule creates an
> error & I'd like to "switch off" squid.
> Signed 
> Mystified (keith spencer)
> Thanks heaps

Roll your own squid.sh to put in /usr/local/etc/rc.d

(See my attached one)

I found squid was a bitch to kill off properly, so the stop
argument terminates squid and it's little cront, RunCache.

Now you can just run it from /etc/ppp/ppp.link{up|down]
-- 
Rasputin
Jack of All Trades :: Master of Nuns

--HlL+5n6rz5pIUxbD
Content-Type: application/x-sh
Content-Disposition: attachment; filename="squid.sh"

#!/bin/sh

if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1
fi

case "$1" in
start)
        if [ -x ${PREFIX}/sbin/RunCache -a -f ${PREFIX}/etc/squid/squid.conf ]; then
                (cd /tmp; ${PREFIX}/sbin/RunCache >/dev/null 2>&1 & && echo ${!} > /var/run/RunCache.pid); echo -n ' squid'
        fi
        ;;
stop)
        /bin/kill `cat /usr/local/squid/logs/squid.pid` `cat /var/run/RunCache.pid`
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

--HlL+5n6rz5pIUxbD--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010419103729.E24896>