X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=etc%2Fyaz-proxy-ka.sh;h=20d1a4676cf4eafba76db583239b4d879a2454f8;hb=1cfab015d330b201317e6437fb144c9ea4cb2cd6;hp=551eca75751f26af8491c1d490686999fa22c24f;hpb=2c74192108679a47afccf2732041c196745c0d5b;p=yazpp-moved-to-github.git diff --git a/etc/yaz-proxy-ka.sh b/etc/yaz-proxy-ka.sh index 551eca7..20d1a46 100755 --- a/etc/yaz-proxy-ka.sh +++ b/etc/yaz-proxy-ka.sh @@ -1,10 +1,40 @@ #!/bin/sh -# $Id: yaz-proxy-ka.sh,v 1.1 2003-10-24 10:33:01 adam Exp $ +# $Id: yaz-proxy-ka.sh,v 1.3 2003-10-24 12:35:37 adam Exp $ +# +# YAZ proxy keepalive wrapper, use this when testing the proxy. +# +# Allow core dumps when testing. +ulimit -c 200000 +# +LOGFILE=/var/log/yaz-proxy-ka.log +# +touch $LOGFILE || exit 1 i=1 -while test $i -lt 20; do - $* - test $? && exit 0 +while test $i -lt 100; do + date >>$LOGFILE + echo "Starting proxy iteration=$i" >>$LOGFILE + yaz-proxy $* + code=$? + date >>$LOGFILE + echo "Proxy Stopped. Exit code=$code" >>$LOGFILE + if test "$code" = "143"; then + echo "Got TERM. Exiting" >>$LOGFILE + exit 0 + fi + if test "$code" = "129"; then + echo "Got HUP. Exiting" >>$LOGFILE + exit 0 + fi + if test "$code" = "137"; then + echo "Got KILL. Exiting" >>$LOGFILE + exit 0 + fi + if test "$code" = "0"; then + echo "Exit 0. Exiting" >>$LOGFILE + exit 0 + fi if test -f core; then + echo "Saving core file" >>$LOGFILE mv -f core core.`date +%Y%m%d%k%M` fi sleep 1