[Zope] using crontab to restart ZOPE - again
George Osvald
mail@okstudio.com.au
Sun, 24 Sep 2000 02:50:57 +1000
This is a multi-part message in MIME format.
------=_NextPart_000_0001_01C025D2.43C333C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Some time ago I asked for help when setting up crontab to restart ZOPE. I
got a few answers and scripts. This one was sent to me by Adam Karpierz. It
works fine on my RED HAT 6.2 box but I can't get it working on FreeBSD 4.0.
On Linux it doesn't do anything if ZOPE is running. It only restarts when
ZOPE stops working. On FreeBSD it stops and then restarts ZOPE every time. I
wander if anyone knows what should be changed for this script to run on
FreeBSD. Any help would be appreciated.
--------------------------------------------
#! /bin/sh
ZOPEDIR="/home/virtuals/user/zope"
INFOMAIL="mail@okstudio.com.au"
STARTFILE="$ZOPEDIR/start"
STOPFILE="$ZOPEDIR/stop"
PIDFILE="$ZOPEDIR/var/Z2.pid"
PID1ACTIVE=0
PID2ACTIVE=0
if [ -x $STARTFILE ]; then
if [ -r $PIDFILE ]; then
PID1=`cut -d" " -f1 $PIDFILE`
PID2=`cut -d" " -f2 $PIDFILE`
if
ps -p $PID1 >/dev/null 2>&1
then
PID1ACTIVE=1
fi
if
ps -p $PID2 >/dev/null 2>&1
then
PID2ACTIVE=1
fi
fi
if [ $PID1ACTIVE -eq 0 -o $PID2ACTIVE -eq 0 ]; then
$STOPFILE >/dev/null 2>&1
sleep 10
$STARTFILE
date | mail -s"Zope restarted" $INFOMAIL >/dev/null 2>&1
fi
fi
-------------------------------------------------------
Regards,
George
------=_NextPart_000_0001_01C025D2.43C333C0
Content-Type: application/octet-stream;
name="AUTO"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="AUTO"
IyEgL2Jpbi9zaAoKWk9QRURJUj0iL2hvbWUvdmlydHVhbHMvZ29zdmFsZC96b3BlIgpJTkZPTUFJ
TD0ibWFpbEBva3N0dWRpby5jb20uYXUiCgpTVEFSVEZJTEU9IiRaT1BFRElSL3N0YXJ0IgpTVE9Q
RklMRT0iJFpPUEVESVIvc3RvcCIKUElERklMRT0iJFpPUEVESVIvdmFyL1oyLnBpZCIKUElEMUFD
VElWRT0wClBJRDJBQ1RJVkU9MAppZiBbIC14ICRTVEFSVEZJTEUgXTsgdGhlbgogIGlmIFsgLXIg
JFBJREZJTEUgXTsgdGhlbgogICAgUElEMT1gY3V0IC1kIiAiIC1mMSAkUElERklMRWAKICAgIFBJ
RDI9YGN1dCAtZCIgIiAtZjIgJFBJREZJTEVgCiAgICBpZgogICAgcHMgLXAgJFBJRDEgPi9kZXYv
bnVsbCAyPiYxIAogICAgdGhlbgogICAgICBQSUQxQUNUSVZFPTEKICAgIGZpCiAgICBpZgogICAg
cHMgLXAgJFBJRDIgPi9kZXYvbnVsbCAyPiYxCiAgICB0aGVuCiAgICAgIFBJRDJBQ1RJVkU9MQog
ICAgZmkKICBmaQogIGlmIFsgJFBJRDFBQ1RJVkUgLWVxIDAgLW8gJFBJRDJBQ1RJVkUgLWVxIDAg
XTsgdGhlbgogICAgJFNUT1BGSUxFID4vZGV2L251bGwgMj4mMQogICAgc2xlZXAgMTAKICAgICRT
VEFSVEZJTEUKICAgIGRhdGUgfCBtYWlsIC1zIlpvcGUgcmVzdGFydGVkIiAkSU5GT01BSUwgPi9k
ZXYvbnVsbCAyPiYxCiAgZmkKZmkK
------=_NextPart_000_0001_01C025D2.43C333C0--