File: RunAccel.in

package info (click to toggle)
squid 2.5.9-10sarge5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 11,284 kB
  • ctags: 11,675
  • sloc: ansic: 88,068; sh: 17,190; makefile: 1,485; perl: 1,223; awk: 36
file content (36 lines) | stat: -rw-r--r-- 729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
#  $Id: RunAccel.in,v 1.5.8.1 2003/01/06 20:52:55 wessels Exp $

# enable HTTP requests on port 80
port="-a 80"

prefix=@prefix@
exec_prefix=@exec_prefix@
logdir=@localstatedir@
PATH=@sbindir@:/bin:/usr/bin
export PATH

if test $# = 1 ; then
	conf="-f $1"
	shift
fi

failcount=0
while : ; do
	echo "Running: squid $port -s $conf >> $logdir/squid.out 2>&1"
	start=`date '+%d%H%M%S'`
	squid -N $port -s $conf >> $logdir/squid.out 2>&1
	stop=`date '+%d%H%M%S'`
	t=`expr $stop - $start`
	if test 0 -le $t -a $t -lt 5 ; then
		failcount=`expr $failcount + 1`
	else
		failcount=0
	fi
	if test $failcount -gt 5 ; then
              echo "RunCache: EXITING DUE TO REPEATED, FREQUENT FAILURES" >&2
		exit 1
	fi
	sleep 10
done