pkgsrc/www/squid/files/squid.sh
taca 67ffacebec Update squid package to squid-2.5.3nb3.
- fix startup script as PR pkg/22502 by Steven M. Bellovin
- includes newer official squid patches except
  squid-2.5.STABLE3-coss-improvements-2.patch (which is broken).

o 2003-07-22 15:22 (Cosmetic)
	statCounter.syscalls.disk counters treated inconsistently

o 2003-07-25 17:25 (Minor)
	Improvements to the (experimental) COSS storage scheme.

o 2003-07-28 09:28 (Minor)
	Blank username logging fix

o 2003-07-29 22:29 (Minor)
	More improvements to the (experimental) COSS storage scheme.

o 2003-08-06 13:06 (Medium)
	assertion failed: http.c:869: "-1 == cfd || FD_SOCKET == fd_table[cfd].type"

o 2003-08-06 14:06 (Medium)
	assertion failed: client_side.c:1478: "size > 0" when using aufs

o 2003-08-06 14:06 (Minor)
	aufs calculates the number of threads and queue limits wrongly

o 2003-08-10 07:10 (Cosmetic)
	Compile error in auth/digest_auth.c

o 2003-08-10 19:10 (Minor)
	Username not logged into ACCESS.LOG in case of /407

o 2003-08-13 00:13 (Minor)
	ICP dynamic timeout algorithm ignores multicast
2003-08-18 16:03:01 +00:00

99 lines
1.8 KiB
Bash

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: squid.sh,v 1.17 2003/08/18 16:03:03 taca Exp $
#
# PROVIDE: squid
# REQUIRE: DAEMON
# KEYWORD: shutdown
conf_file="@PKG_SYSCONFDIR@/squid.conf"
name="squid"
rcvar=$name
command="@PREFIX@/sbin/${name}"
pidfile="/var/run/${name}.pid"
required_files="${conf_file} @PKG_SYSCONFDIR@/mime.conf"
command_args="-Y -f $conf_file"
start_cmd="${command} ${command_args}"
stop_cmd="stop_nicely"
kill_command="${command} -k shutdown"
reload_cmd="${command} -k reconfigure"
rotate_cmd="${command} -k rotate"
createdirs_cmd="squid_createdirs"
#### end of configuration section ####
# XXX Shouldn't the default stop_cmd be this patient too?
#
stop_nicely ()
{
if [ -f ${pidfile} ] ; then
DAEMON_PID=`sed 1q ${pidfile}`
@ECHO@ -n "Stopping ${name}"
${kill_command}
if [ ${DAEMON_PID} -ne 0 ]; then
@ECHO@ -n '['
for WAIT in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
do
if kill -0 ${DAEMON_PID} >/dev/null 2>&1; then
sleep 4
@ECHO@ -n '.'
test $WAIT -lt 15 || kill ${DAEMON_PID}
else
break
fi
done
@ECHO@ '].'
unset WAIT
fi
unset DAEMON_PID
fi
}
# create the squid cache directories
squid_createdirs()
{
${start_cmd} -z
}
if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
. /etc/rc.subr
. /etc/rc.conf
extra_commands="createdirs reload rotate"
load_rc_config $name
run_rc_command "$1"
else # old NetBSD, Solaris, Linux, etc...
case $1 in
start)
if [ -x ${command} -a -f ${conf_file} ] ; then
eval ${start_cmd} && @ECHO@ -n " ${name}"
fi
;;
stop)
${stop_cmd}
;;
createdirs)
squid_createdirs
;;
reload)
if [ -f ${pidfile} ] ; then
${reload_cmd}
fi
;;
rotate)
if [ -f ${pidfile} ] ; then
${rotate_cmd}
fi
;;
*)
@ECHO@ "Usage: $0 {start|stop|reload|createdirs}" 1>&2
exit 64
;;
esac
fi