From owner-freebsd-questions Thu Apr 19 2:37:34 2001 Delivered-To: freebsd-questions@freebsd.org Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by hub.freebsd.org (Postfix) with ESMTP id 0C6F137B423 for ; Thu, 19 Apr 2001 02:37:31 -0700 (PDT) (envelope-from rasputin@freebsd-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97] ident=root) by serenity.mcc.ac.uk with esmtp (Exim 2.05 #4) id 14qAsU-000Li1-00 for questions@freebsd.org; Thu, 19 Apr 2001 10:37:30 +0100 Received: (from rasputin@localhost) by dogma.freebsd-uk.eu.org (8.11.1/8.11.1) id f3J9bTt25499 for questions@freebsd.org; Thu, 19 Apr 2001 10:37:30 +0100 (BST) (envelope-from rasputin) Date: Thu, 19 Apr 2001 10:37:29 +0100 From: Rasputin To: questions@freebsd.org Subject: Re: How on earth does Squid-2.3 init???? Message-ID: <20010419103729.E24896@dogma.freebsd-uk.eu.org> Reply-To: Rasputin References: <20010419084858.69981.qmail@web12006.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="HlL+5n6rz5pIUxbD" X-Mailer: Mutt 1.0.1i In-Reply-To: <20010419084858.69981.qmail@web12006.mail.yahoo.com>; from bsd2000au@yahoo.com.au on Thu, Apr 19, 2001 at 06:48:58PM +1000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii * k s [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