[squid-users] About the "null" thing on reloading squid.

From: Eliezer Croitoru <eliezer_at_ec.hadorhabaac.com>
Date: Sun, 06 Feb 2011 02:35:41 +0200

i have found something about it.
it happends only using one method.

i am using a init.d script:

service squid3 reload
or the same
/etc/init.d/squid3 reload

and then after that im getting the (null)://
error page.

so i tried using another method of reloading\reconfiguring the proxy for
another purpose.
(i started using a ram drive for small objects to make them load faster.)

i was using the command
squid3 -k reconfigure
and it seems to be ok.

my init.d script is on the buttom of the mail.

another question i have is:
is there like a good way to benefit from the ramfs drive?

a way to make most small objects go there?

i have tried putting them one obove the other on the list. of cache.
and nothing got into the ramfs but when i used round robin algorithm for
the cache dir it seems like the proxy using it.

the init.d script:
#############start#######################
! /bin/sh
#
# squid3 Startup script for the SQUID HTTP proxy-cache.
#
# Version: @(#)squid3.rc 1.0 07-Jul-2006 luigi_at_debian.org
#
### BEGIN INIT INFO
# Provides: squid3
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: $named
# Should-Stop: $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Squid HTTP Proxy version 3.x
### END INIT INFO

NAME=squid3
DESC="Squid HTTP Proxy 3.x"
DAEMON=/usr/sbin/squid3
PIDFILE=/var/run/$NAME.pid
CONFIG=/etc/squid3/squid.conf
SQUID_ARGS="-YC -f $CONFIG"
RAMFS=$RAMFS

[ ! -f /etc/default/squid3 ] || . /etc/default/squid3

. /lib/lsb/init-functions

PATH=/bin:/usr/bin:/sbin:/usr/sbin

[ -x $DAEMON ] || exit 0

ulimit -n 65535

find_cache_dir () {
         w=" " # space tab
         res=`sed -ne '
                 
s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
                 t end;
                 d;
                 :end q' < $CONFIG`
         [ -n "$res" ] || res=$2
         echo "$res"
}

find_cache_type () {
         w=" " # space tab
         res=`sed -ne '
                 s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
                 t end;
                 d;
                 :end q' < $CONFIG`
         [ -n "$res" ] || res=$2
         echo "$res"
}

start () {
         $RAMFS clean
         $RAMFS mount
         $RAMFS restore

         cache_dir=`find_cache_dir cache_dir /var/spool/squid3`
         cache_type=`find_cache_type cache_dir ufs`

         #
     # Create spool dirs if they don't exist.
     #
         if [ "$cache_type" = "coss" -a -d "$cache_dir" -a ! -f
"$cache_dir/stripe" ] || [ "$cache_type" != "coss" -a -d "$cache_dir" -a
! -d "$cache_dir/00" ]
         then
                 log_warning_msg "Creating $DESC cache structure"
                 $DAEMON -z
         fi

         umask 027
         ulimit -n 65535

         cd $cache_dir
         start-stop-daemon --quiet --start \
                 --pidfile $PIDFILE \
                 --exec $DAEMON -- $SQUID_ARGS < /dev/null
         return $?
}

stop () {

         PID=`cat $PIDFILE 2>/dev/null`
         start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
         #
         # Now we have to wait until squid has _really_ stopped.
         #
         sleep 2
         if test -n "$PID" && kill -0 $PID 2>/dev/null
         then
                 log_action_begin_msg " Waiting"
                 cnt=0
                 while kill -0 $PID 2>/dev/null
                 do
                         cnt=`expr $cnt + 1`
                         if [ $cnt -gt 24 ]
                         then
                                 log_action_end_msg 1
                                 return 1
                         fi
                         sleep 5
                         log_action_cont_msg ""
                 done
                 log_action_end_msg 0
                 return 0
         else
                 return 0
         fi
}

case "$1" in
     start)
         log_daemon_msg "Starting $DESC" "$NAME"
         if start ; then
                 log_end_msg $?
         else
                 log_end_msg $?
         fi
         ;;
     stop)
         log_daemon_msg "Stopping $DESC" "$NAME"

         if stop ; then
                 log_end_msg $?
         else
                 log_end_msg $?
         fi
         $RAMFS dump
         $RAMFS umount
         $RAMFS clean

         ;;
     reload|force-reload)
         log_action_msg "Reloading $DESC configuration files"
         start-stop-daemon --stop --signal 1 \
                 --pidfile $PIDFILE --quiet --exec $DAEMON
         log_action_end_msg 0
         ;;
     restart)
         log_daemon_msg "Restarting $DESC" "$NAME"
         stop
         if start ; then
                 log_end_msg $?
         else
                 log_end_msg $?
         fi
         ;;
     *)
         echo "Usage: /etc/init.d/$NAME
{start|stop|reload|force-reload|restart}"
         exit 3
         ;;
esac

exit 0

########################end#############

Thanks Eliezer
Received on Sun Mar 06 2011 - 00:39:03 MST

This archive was generated by hypermail 2.2.0 : Sun Mar 06 2011 - 12:00:01 MST