comments on squid installation

From: Bob Vickers <bobv@dont-contact.us>
Date: Fri, 12 Jun 1998 11:25:58 +0100 (BST)

Hi Chaps,

I recently installed Squid 1.1.21, and so far it seems to be running very
well. But I just thought I would make a few comments on the way you have
to start the daemon; I feel a small amount of effort here would simplify
the installation process:

(1) Most unix daemons disconnect themselves from the terminal which starts
them, either automatically or optionally according to a command-line
parameter. It shouldn't be necessary to start a daemon with nohup.

(2) The supplied RunCache script sets the log directory (by default) to
/usr/local/squid. I suspect this is a mistake; in my view
/usr/local/squid/logs would be more appropriate. For security reasons you
don't want the squid daemon to have write access to its own software or
configuration files.

(3) The feature in RunCache to automatically restart after a failure is
very clever, but makes it difficult or impossible to terminate Squid when
you need to. If the feature is to remain then it ought to distinguish
between planned and unplanned terminations.

(4) It is conventional on System V derived Unixes (e.g. Solaris, Digital
Unix and IRIX) to start and stop daemons with the same script. It would be
helpful if one were distributed; here is the one I use:
-------------------start of squid script-------------------------------
#! /usr/bin/ksh
#
# Start the Squid proxy web cache server, in a secure manner.
# Written by Bob Vickers, 8 June 1998.

umask 022
set -o nounset

SQUID_DIR=/usr/local/squid
LOG_DIR=$SQUID_DIR/logs
PID_FILE=$LOG_DIR/squid.pid
BIN_DIR=$SQUID_DIR/bin
SQUID_USER=webcache

PATH=$BIN_DIR:/bin ; export PATH

if [ ! -d $SQUID_DIR ]
then
        echo "$0: cannot start/stop web cache server" >&2
        exit 1
fi

case "$1" in
'start')
    # Start the web cache server
    cd $LOG_DIR || exit 1
    echo "Starting squid"
    su $SQUID_USER -c "nohup squid -sY >> squid.out 2>&1 &"
    ;;

'stop')
     # Stop the web cache server
     pids1=`cat $PID_FILE`
     pids2=`echo $pids1` # no linefeeds
     su $SQUID_USER -c "/sbin/kill $pids2"
     echo "$0: Stopping web cache server"
     ;;
esac
-------------------end of squid script-------------------------------

Thanks for reading this far,
Bob
======================================================================
Bob Vickers R.Vickers@dcs.rhbnc.ac.uk
Dept of Computer Science, Royal Holloway College, University of London
WWW: http://www.cs.rhbnc.ac.uk/home/bobv
Phone: +44 1784 443691
Received on Fri Jun 12 1998 - 03:26:53 MDT

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