Re: [Zope] Using crontab instead of rc.d
Hello, Here's something I put together. I am pretty much clueless when it comes to bash shell programming, so this may be a really bad way to do things. I would think you could run this script from your crontab. I tried this on Redhat 6.2 , so YMMV. -garrin -- begin script -- #!/bin/bash ZOPEHOME=/var/Zope-2.2.0-linux2-x86 DEAD=" " for pid in `cat $ZOPEHOME/var/Z2.pid`; do status=`ps --no-headers -p $pid` if test $status == $DEAD; then echo "Restarting Zope" nohup $ZOPEHOME/start break; fi done -- end script -- On Thu, 24 Aug 2000, George Osvald wrote: Hello everyone! My ISP where I have my web page, is running freeBSD 4.0. I do not know a lot about it. I know how to use crontab to start ZOPE at certain time how ever how do I use crontab to check on the script that is already running? Starting ZOPE again when it's running produces an error message and I do not know if that was a healthy solution. to start it I would be using something like: 5 * * * * root./start This would start the script every five minutes. Now how do I check if the script is running after it's been started and if it wasn't to restart it again. Also I was thinking to run ZOPE in DEBUG mode. That way it stays attached to the terminal (crontab I guess). I know about z2.pid. Nevertheless I find ZOPE down quite often every time they do something at the ISP. I asked them what to do and they told me to use crontab to check the script and restart it. For some reason they don't want me to use rc.d If I could guarantee to remove the z2.pid every time ZOPE goes down, I could apparently include something like this: if [ -x /home/virtuals/account/zope/z2.pid ] then // exit(0) fi 5 * * * * root./start to check if the file is present and if not to run the script. That can't be done when ZOPE exits abnormally though. Is this setup at all possible? Regards, George Osvald ___ 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 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] Products vs. ZClasses- Design Question
Hello, I would like some thoughts on design strategies for Zope classes. I am developing a site that will require writing some custom classes. I would appreciate any opinions anyone could offer. I apologize for such a long message. My class will have some instance variables along with some standard Zope subobjects. My principal concern is that, because the graphical design of the site is still in development, I will probably be making lots of changes to the user interface of the class. I will want those changes to be propogated to existing instances of the class. The underlying logic, however, should be fairly stable. I've thought of three ways to develop the class: 1. Develop the entire class as a Zope product in Python. The advantage I see here is that developing the application logic is fairly straightforward with Python. I see problems, though, with the user interface, especially if I want to make changes to it after instantiating a few objects. It is my understanding that objects created from a Product are not automatically updated when changes are made to the class methods (as opposed to ZClasses, where they are). Am I correct here? 2. Develop the entire class as a ZClass The principal advantage I see is that changes to the class methods are dynamically updated in all instances of that ZClass. The problem is that DTML is (for me, at least) a pain in the ass to write any complicated application logic with. 3. Develop the application logic as a Product in Python, then use that class as a mix-in class for a ZClass that implements UI logic with dtml methods. This seems to be the best solution (even if it is the most work). I should get the advantage of having ZClass instances automatically update changes to ZClass methods, while having the programability of Python for application logic in the Product. If I do take this route, are there any quirks I should be aware of when inheriting a ZClass from a product? I am new to Zope and would appreciate any insight into the tradeoffs among these three strategies. Thank you, Garrin ___ 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 )