Re: How to prevent a long swap.state reb

From: Robin Bowes <Robin.Bowes@dont-contact.us>
Date: Wed, 26 May 1999 10:45:00 +0100

Thilo Manske wrote:
> Do you rotate your logs regularly? (squid -k rotate)
> This will "write clean logs", I'm not sure what this means but I see
> this in my cache log. Maybe this will help peed up recovery after squid
> has crashed or was killed or whatever.

Well, I've got things up and running again. I ended up trashing the
cache and starting again as it was taking too long to rebuild
swap.state.

I've now got a script in /etc/rc.shutdown that runs all scripts in
${local_startup} with a "stop" parameter. I am running squid under
djb's supervise (from daemontools) and my start/stop script is listed at
the end of this message.

One thing I have noticed; what is supposed to happen after a "squid -k
rotate"? How does this affect the ability of squid to restart quickly?
What I see happening is swap.state.last-clean being written; 0 bytes
with a timestamp of when the command was issued. Is this correct?

Thanks,

R.

#! /bin/sh -
#
# description: Start, stop, restart, reload, and otherwise signal squid
\
# Makes heavy use of parts of DJB's daemontools package \
# It also relies upon daemontools.functions for 91.04982%
\
# of the grunt work.
#
# customize
PROG=squid # what program?
DIR=/var/lock/$PROG # a directory
for supervise to use
LOGDIR=/var/log/$PROG # directory for
logs
LOGUSER=squid # user to own
logs
INITDIR=/usr/local/etc/rc.d # location of
initscripts
WAIT=30 # time (secs) to
wait for the program to exit
                                                        # (used by
stop() in daemontools.functions
CONF=/usr/local/etc/squid/squid.conf # program config
file to use
PROGOPTS=-NsY # options to
program

# Grab the daemontools init functions
. $INITDIR/daemontools.functions
export PATH=/usr/local/sbin:/usr/local/bin:$PATH

start() {
    if check; then
        echo "$PROG is already running"
    else
        echo -n "Starting $PROG..."
        supervise $DIR $PROG $PROGOPTS $CONF >> $LOGDIR/$PROG.out &
        echo "done"
    fi
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        restart
    ;;
    status)
        status
    ;;
    help)
        help
    ;;
    *)
        signal $1
    ;;
esac

 --
Robin Bowes, System Development Manager, Equal Opportunities Commission,
Room 405A, Overseas House, Quay St., Manchester, M3 3HN, UK.
Tel: +44 (0) 161 838 8321 Fax: +44 (0) 161 835 1657
Received on Wed May 26 1999 - 03:54:59 MDT

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