Re: [Zope] using crontab to restart ZOPE - again

2000-09-24 Thread Aleksander Salwa


On Sun, 24 Sep 2000, George Osvald wrote:

> 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.

> PID1=`cut -d" " -f1 $PIDFILE`
> PID2=`cut -d" " -f2 $PIDFILE`

On FreeBSD command "cut" doesn't like lines not terminated with new-line
character. Zope's pidfiles aren't LF-terminated :(
Possible solution:
Patch Zope - add LFs (file "z2.py" - line 712, "lib/python/zdaemon" -
line 203)

[EMAIL PROTECTED]

/--\
| `long long long' is too long for GCC |
\--/



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] using crontab to restart ZOPE - again

2000-09-23 Thread George Osvald

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="[EMAIL PROTECTED]"

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


 AUTO