quick search:
 

ZEO as a windows service

Submitted by: apatt
Last Edited: 2005-03-08

Category: ZEO

Average rating is: 5.0 out of 5 (1 ratings)

Description:
Zeo's great, but the support on windows is a little lacking. While Zope will run as a service just fine, the default install does not setup zeo to run as a service like it does for Zope. I looked around and couldn't find a solution. I finally realized that I could modify the zopeservice.py file to do the same thing for zope, and it worked out just fine.

Source (Text):
see  below

Explanation:
Let's assume $ZOPEBASE is where the base Zope files are installed. $ZOPEINSTANCE is where a Zope instance is installed (NOT the base files, but an instance). $ZEOINSTANCE is the instance where the instance Zeo is installed. Replace your values for these variables below.

1. Do a zope install and create one Zope instance. (which is done in the standard win32 double-click install)
2. To create a Zeo instance, at a command prompt type "$ZOPEBASE\bin\python.exe $ZOPEBASE\lib\python\ZEO\mkzeoinst.py" (without the quotes) This creates the structure for the zeo instace.
3. Put the data.fs file you want to publish in the var directory of the Zeo instance. For a new install this will come from the $ZOPEINSTANCE\var. Be sure you shutdown the Zope instance before copying/moving the Data.fs file
4. Copy runzope.bat from the $ZOPEINSTANCE\bin to $ZEOINSTANCE\bin.
5. Rename runzope.bat to runzeo.bat
6. make the following edits in runzeo.bat:
* Find INSTANCE_HOME and adjust the value be $ZEOINSTANCE.
* Find ZOPE_RUN and change Zope\Startup\run.py to ZEO\runzeo.py
* Find CONFIG_FILE and change the path where the zeo.conf file lives for that instance. zeo.conf should be at the end of the path.
* Save file
7. This will allow you to run zeo from a command line easily.
8. Now we want to create a service for this instance. Copy zopeservice.py from the instance) to the bin directory of the zope instance.
9. Copy zopeservice.py from the $ZOPEINSTANCE\bin to $ZEOINSTANCE\bin.
10. Rename zopeservice.py to zeoservice.py
11. Make the following edits in zeoservice.py:
* Find INSTANCE_HOME and adjust the value be $ZEOINSTANCE
* Find ZOPE_RUN and change Zope\Startup\run.py to ZEO\runzeo.py
* Find CONFIG_FILE and change zope.conf to zeo.conf
* Find servicename and change Zope_ to Zeo_
* Find _svc_display_name_ and change Zope instance to Zeo Instance
* Save file
12. At a command prompt type $ZOPEBASE\bin\python.exe $ZEOINSTANCE\bin\zeoservice.py --startup auto install
13. At a command prompt type $ZOPEBASE\bin\python.exe $ZEOINSTANCE\bin\zeoservice.py start
14. Check the windows event log to see if any errors about a python service not starting correctly. It's really easy to miss one simple edit that will kill everything.


Comments:

Configuring Plone 2? by sd - 2004-10-14
This is a great start! [As far as I can tell, the second sentence in Step 8 is redundant.]

I followed the instructions and the ZEO is alive on my Win 2k box. But when I return to the ZMI, nothing is available. My installation is based on the standard Plone 2 Windows installer. I assume there are other config files to edit to make Zope (and Plone) appear once again in the browser. Do you have any guidelines on where to look to hook up the rest of the plumbing?

Thanks!


A little more info by sstults - 2005-03-08
Thank you for putting these instructions up!  I was able to get the
ZEO server and Zope client up and running as services in no time.
I would suggest the following edits to these instructions:

2. If you follow this instruction you'll be greeted with:

     Usage: mkzeoinst.py home [port]

   Even though it says "port" you need to enter a new path that will
   point to your ZEO instance.  For example:

     $ZOPEBASE\bin\python.exe $ZOPEBASE\lib\python\ZEO\mkzeoinst.py "c:\Program Files\Plone 2\ZEO"

8. Ignore this line altogether.  The correct instruction is line 9.


Next, you'll need to connect your Zope instance to the ZEO server:

15. Edit $ZOPEINSTANCE\var\zope.conf

16. Comment zodb_db main (filestorage), uncomment ZEO client storage

17. Change the port number from 8100 to 9999

18. Start your Zope client.  It may be easier to debug problems if 
    you do this from the command-line in debug mode, such as:

      $ZOPEINSTANCE\bin\runzope.bat -X "debug-mode=on"

If everything is set up correctly, you should see a flood of log
entries such as:

  2005-03-08T11:20:38 TRACE(-300) zrpc-conn:localhost:9999 (something)

followed by the familiar and beautiful:

  2005-03-08T11:20:38 INFO(0) Zope Ready to handle requests