Subject: pkg/13706: Squid MUST shut down cleanly, no matter how long it takes!
To: None <>
From: Greg A. Woods <>
List: netbsd-bugs
Date: 08/13/2001 13:36:54
>Number:         13706
>Category:       pkg
>Synopsis:       Squid MUST shut down cleanly, no matter how long it takes!
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 13 11:48:00 PDT 2001
>Originator:     Greg A. Woods
>Release:        2001/08/13
Planix, Inc.; Toronto, Ontario; Canada


	You MUST allow squid to shutdown cleanly if you want it to run
	cleanly after reboot!!!!  Squid writes out its cache swap files
	and if those files are corrupt or incomplete more damage will be
	done than if they don't exist.  Indeed if they are corrupt or
	incomplete the entire cache filesystem may need re-creating!

	If squid does not shutdown cleanly in a timely fashion then
	there are any number of ways for a competent administrator to
	access the system again during the stuck shutdown and debug the
	problem; while an incompetent admin can do no more damage by
	simply powering off the system or manually resetting the
	hardware!  Indeed a hard power-off or reset is likely to be
	safer because it may trigger fsck into removing the corrupt or
	incomplete cache swap file(s)!


	run a large squid that takes more than 20 seconds to shut itself
	down and face the consequences.


	The following change corrects the behaviour of etc/rc.d/squid so
	that it works as it must.  The time limit added in 1.10 should
	not ever have been added!  It was WRONG and will cause problems!

Index: files/
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/www/squid/files/,v
retrieving revision 1.10
diff -c -r1.10
*** files/	2001/07/30 07:30:12	1.10
--- files/	2001/08/13 17:28:24
*** 34,51 ****
  		if [ ${DAEMON_PID} -ne 0 ]; then
  			echo -n '['
! 			for WAIT in 0 1 2 3 4 5 6 7 8 9
! 			do
! 				if kill -0 ${DAEMON_PID} >/dev/null 2>&1; then
! 					sleep 2
! 					echo -n '.'
! 					test $WAIT -lt 9 || kill ${DAEMON_PID}
! 				else
! 					break
! 				fi
  			echo '].'
- 			unset WAIT
  		unset DAEMON_PID
--- 34,44 ----
  		if [ ${DAEMON_PID} -ne 0 ]; then
  			echo -n '['
! 			while kill -0 ${DAEMON_PID} >/dev/null 2>&1; do
! 				sleep 2
! 				echo -n '.'
  			echo '].'
  		unset DAEMON_PID