[Zope] Using crontab instead of rc.d
Adam Karpierz
karpierz@itl.pl
Wed, 23 Aug 2000 21:01:48 +0200
>Is this setup at all possible?
>
>Regards,
>
>George Osvald
Hi George
It's my working solution (Linux RH):
crontab command
-------------------------
0,30 * * * * /home/adares/.start
setup file: /home/adares/.start
----------------------------------
#! /bin/sh
ZOPEDIR="/home/adares/Zope"
PORTMASK="8000"
INFOMAIL="adares@alpha.pl"
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 -P $PORTMASK -Z 'var/Z2.pid'
date | mail -s"Zope restarted" $INFOMAIL >/dev/null 2>&1
fi
fi
Regards
--
Adam Karpierz
karpierz@alpha.pl
begin 666 .start
M(R$@+V)I;B]S: H*6D]0141)4CTB+VAO;64O861A<F5S+UIO<&4B"E!/4E1-
M05-+/2(X,# P(@I)3D9/34%)3#TB861A<F5S0&%L<&AA+G!L(@H*4U1!4E1&
M24Q%/2(D6D]0141)4B]S=&%R="(*4U1/4$9)3$4](B1:3U!%1$E2+W-T;W B
M"E!)1$9)3$4](B1:3U!%1$E2+W9A<B]:,BYP:60B"E!)1#%!0U1)5D4], I0
M240R04-4259%/3 *:68@6R M>" D4U1!4E1&24Q%(%T[('1H96X*("!I9B!;
M("UR("10241&24Q%(%T[('1H96X*(" @(%!)1#$]8&-U=" M9"(@(B M9C$@
M)%!)1$9)3$5@"B @("!0240R/6!C=70@+60B("(@+68R("10241&24Q%8 H@
M(" @:68*(" @('!S("UP("10240Q(#XO9&5V+VYU;&P@,CXF,2 *(" @('1H
M96X*(" @(" @4$E$,4%#5$E613TQ"B @("!F:0H@(" @:68*(" @('!S("UP
M("10240R(#XO9&5V+VYU;&P@,CXF,0H@(" @=&AE;@H@(" @("!0240R04-4
M259%/3$*(" @(&9I"B @9FD*("!I9B!;("10240Q04-4259%("UE<2 P("UO
M("10240R04-4259%("UE<2 P(%T[('1H96X*(" @("135$]01DE,12 ^+V1E
M=B]N=6QL(#(^)C$*(" @('-L965P(#$P"B @(" D4U1!4E1&24Q%("U0("10
M3U)434%32R M6B G=F%R+UHR+G!I9"<*(" @(&1A=&4@?"!M86EL("US(EIO
M<&4@<F5S=&%R=&5D(B D24Y&3TU!24P@/B]D978O;G5L;" R/B8Q"B @9FD*
#9FD*
`
end