You are not logged in Log in Join
You are here: Home » Members » mmceahern » Installing, configuring, and administering ZEO

Log in
Name

Password

 

Installing, configuring, and administering ZEO

Summary

This document describes in detail how to install, configure, and administer ZEO in conjunction with Zope. Since I haven't gotten it to work yet, I discuss all the alternatives I've tried.

This is not an introduction to ZEO. Please see the references [ref] for that.

Update

I have gotten scenario 3 to work [scenario3] at least from a Hello World perspective (I can login to the ZMI and the Control Panel | Database Management tab indicates ClientStorage is being used).

The other scenarios I've documented:

fail in the same way. Zope works fine if I omit custom_zodb.py (that is, without ZEO). ZEO works fine, as demonstrated with the non-Zope test script [testzeo]. When I add the custom_zodb.py to the instance home (which in scenario 2 is the same as software home), Zope appears to start just fine (when I examine the stupid log file, there are no errors). However, when I access the ZMI (e.g., http://localhost:8080/manage), Zope seems to hang--and nothing is written to the stupid log file.

Versions

These are the versions of ZEO, Zope, and Python I discuss in this document.

ZEO

  • 2.0b1
  • 1.0

Zope

  • 2.5.1 SRPM
  • 2.5.1 source tarball
  • 2.5.1 binary tarball
  • 2.5 from CVS branch Zope-2_5-branch (this is a stable bugfix branch)
  • CVS branch chrism-install-branch, see Installation and Configuration Proposal

Python

  • 2.1.3 SRPM
  • 2.1.3 source tarball, plain (i.e., ./configure)
  • 2.1.3 source tarball, large file support
  • 2.1.3 source tarball, explicit with threads and without pymalloc

Operating system

I performed these installations on Red Hat Linux 7.3 unless otherwise noted.

All the command samples that aren't prefixed by "sudo" are performed as a normal user. That won't work for you unless you configure /etc/sudoers. I simply added the following line to /etc/sudoers:

        mark    ALL=(ALL) ALL

If you haven't configured /etc/sudoers, consider it. Otherwise, simply login as root (i.e., type su) and issue those commands prefixed by sudo as root (you can omit the "sudo" in that case). The advantage of sudo is you don't get in the bad habit of doing everything as root, rather you only do those things you need to do as root.

Single point of failure

You cannot install ZEO without first installing Zope. However, you don't have to run Zope on the computer where your ZEO storage server (ZSS) resides. If you can afford the hardware, it's preferable from the standpoint of reliability to run ZEO on a separate computer from your Zope client(s). The reason is that your ZSS becomes your single point of failure and you want to minimize the risk that something can go wrong on the computer where it resides. The general principle is the fewer things you run, the fewer chances something can go wrong.

Having said that, it's convenient to be able to install both ZEO and the Zope client on the same computer when you're just getting familiar with ZEO.

Installation overview

The basic process of installing, configuring, and running ZEO is:

  1. Install Python.
  2. Install Zope.
  3. Install ZEO.
  4. Configure ZEO.
  5. Start ZEO.

The basic process of installing, configuring, and running a Zope client is:

  1. Install, configure, and start ZEO.
  2. Install Python.
  3. Install Zope.
  4. Configure Zope.
  5. Start Zope.

Configuration overview: ZEO

TODO: Refine this section!

When you start ZEO, you don't need to specify a storage for ZEO to serve. If you don't specify a storage, it will serve up a default storage derived from the environment. I prefer to specify the storage for ZEO to serve explicitly rather than rely on this implicit behavior.

The way you specify a storage for ZEO to serve (it can serve more than one storage) is with the -S option to ZEO's start.py. You can see our sample zeo_start file [zeostart] specifies this option explicitly. This is the syntax of the -S option:

        -S storage_name=module_name:attribute_name

I haven't figured out a good layout for ZEO yet, so in the meantime, I just place my storage module in the ZEO folder and name it StorageConfig.py. When you specify the module_name in the -S option, you omit the .py extension. The storage_name is the name by which ZEO clients will specify the storage they want to be served. The attribute_name is the name assigned to the storage in the module.

Configuring ZEO involves:

  1. Writing a script [zeostart] that calls ZEO's start.py with the desired options.
  2. Specify the storage [storageconfig] you want to serve in a Python module.

Notice that we explicitly specify the storage to serve in zeo_start via the -S option. Without that, ZEO will derive the storage to serve from the environment. When you're trying to understand what's happening, this implicit behavior can be confusing, to say the least. Our -S option (-S main:StorageConfig:main_storage) says ZEO should look for a StorageConfig.py module (notice the option omits the .py extension and serve up as main the storage identified in that module as main_storage. That is, ZEO clients will refer to the storage as main. So you need to copy the

One of the things that confused me about this particular installation scenario is after I installed Zope, I had two Data.fs files: one in /usr/share/zope/var and one in /var/zope/var. The reason is the Zope RPM was designed to create an INSTANCE_HOME in /var/zope/. Once I understood that, I still wondered, "So which Data.fs do I serve up from ZEO?"

In other words, if I have a dedicated ZEO machine, INSTANCE_HOME is not only irrelevant, it seems confusing. I realize ZEO is piggybacking on top of Zope, but it might go a long way towards clarifying the administration tasks specific to ZEO to make the installation of ZEO less dependent on and bound up with the installation of Zope since it seems likely that ZEO will often be run on a dedicated machine where Zope will not be run.

Use cases

These are the use cases I discuss:

  • Installing ZEO
  • Running ZEO with one Zope client on the same computer
  • Running ZEO with one Zope client on a different computer
  • Running ZEO with multiple Zope clients
  • Migrating from a standalone Zope server to ZEO
  • Managing a Zope client: Products, External Methods, etc.

Installing ZEO

These are the scenarios I've tried:

  • Installation scenario 1: RPM [scenario1]
  • Installation scenario 2: Source tarball, latest distributed releases [scenario2]
  • Installation scenario 3: CVS, various branches [scenario3]
  • Installation scenario 4: Red Hat 7.2, ZEO 1, previous releases [scenario4]

[scenario1]

Installation scenario 1: RPM

I prefer RPMs because they are simple to install and remove; and they provide a uniform way to query what's installed. Further, if you need esoteric compilation switches, you can make your own RPM.

The approach I describe in this scenario has several disadvantages:

  • The simple test for large file support fails.
  • The ZEO unit tests fail. That seems to be fixed in the CVS version of ZEO.

Install Python

  1. Download the Python 2.1.3 SRPM :
                $ cd /var/tmp
                $ wget http://www.python.org/ftp/python/2.1.3/rpms/python2.1-2.1.3-1.src.rpm
    
  2. Place a copy of the buildrpm [buildrpm] shell script in /var/tmp. Set it's executable bit:
                $ chmod +x /var/tmp/buildrpm
    
  3. Build the RPMs:
                $ buildrpm python2.1-2.1.3-1.src.rpm
    
  4. Install the python and python-devel RPMs:
                $ cd ~/rpm/RPMS/i386
                $ sudo rpm -Uvh python2.1-2.1.3-1.i386.rpm python2.1-devel-2.1.3-1.i386.rpm
    
  5. (Optional) Place a copy of the large file support [lfs] Python script in /var/tmp. Check for large file support:
                $ python2.1 /var/tmp/lfs.py
    

Install Zope

  1. Download the Zope 2.5.1 SRPM :
                $ cd /var/tmp
                $ wget http://www.zope.org/Members/dingo/Zope_RPMS/Zope-2.5.1-1.src.rpm
    
  2. Build the RPMs:
                $ buildrpm Zope-2.5.1-1.src.rpm
    
  3. Install the RPMs:
                $ cd ~/rpm/RPMS/i386
                $ sudo rpm -Uvh Zope-2.5.1-1.i386.rpm Zope-zserver-2.5.1-1.i386.rpm
    

Install ZEO

  1. Download the latest version of ZEO (ZEO 2.0b1 as of this writing) :
                $ cd /var/tmp
                $ wget http://www.zope.org/Products/ZEO/ZEO-2.0b1.tar.gz
    
  2. Unpack the tarball:
                $ tar -zxvf ZEO-2.0b1.tar.gz
    
  3. Build it:
                $ cd ZEO
                $ export PYTHONPATH='/usr/share/zope/lib/python'
                $ python2.1 setup.py build
    
  4. Test it (the repetition of -v makes the output more verbose):
                $ python2.1 test.py -v -v
    
  5. Install it (the RPM installs Zope to /usr/share/zope):
                $ sudo python2.1 setup.py install --home=/usr/share/zope
    

Configure ZEO

  1. There are two scripts that will make our lives easier: zeo_start [zeostart] and zeo_stop [zeostop]. Place a copy of these scripts in /usr/share/zope. Set the executable bit on these scripts:
                $ chmod +x /usr/share/zope/zeo_st*
    
  2. Copy the StorageConfig.py [storageconfig] module to the ZEO directory to define the storage we're serving. Make sure you specify /usr/share/zope as the zope_path.
  3. Make the zope user the owner of everything within /usr/share/zope:

    $ sudo chown -R zope:zope /usr/share/zope

Start ZEO

To start ZEO, you merely need to run zeo_start:

            $ sudo /usr/share/zope/zeo_start

Stop ZEO

To stop ZEO, use zeo_stop:

            $ sudo /usr/share/zope/zeo_stop

Test ZEO

  1. Place a copy of test_zeo.py [testzeo] in /var/tmp.
  2. Run test_zeo.py. Open multiple terminal windows (e.g., 3) and start a copy of test_zeo.py in each of them:
                $ python2.1 /var/tmp/test_zeo.py 127.0.0.1 8800 main /usr/share/zope/lib/python
    

You should see something like this scroll across each screen:

            {'_pack_time': 925771972.67781401, 'Application': <Application instance at 855fd70>}

Configure Zope

  1. We need to modify the start script installed by the RPM (/var/zope/zserver.sh). It's probably a good idea to make a backup of the original:
                $ sudo cp /var/zope/zserver.sh /var/zope/zserver.sh.original
    
  2. Place a copy of the zope start file [zopestartrpm] in /var/zope/zserver.sh.
  3. Make sure the script is owned by the zope user and it's executable.
  4. Place a copy of the custom_zodb.py script [customzodb] in /var/zope. Make sure you specify the zope path in the script.
  5. Make sure the zope user owns all the files in /var/zope:
                $ sudo chown -R zope:zope /var/zope
    
  6. Run the zpasswd.py script to set the administrative password to a known value (admin, 123):
                $ sudo -u zope python2.1 /usr/share/zope/zpasswd.py -u admin -p 123 inituser
    

Start Zope

You can start Zope using the /sbin/service facility:

            $ sudo /sbin/service zope start

Stop Zope

You can stop Zope using the /sbin/service facility:

            $ sudo /sbin/service zope stop

Test Zope

  1. Avoid browser quirks by trying to retrieve the root document directly from telnet:
                (echo -e "GET / HTTP/1.0\n\n"; sleep 5) | telnet 127.0.0.1 8080
    
  2. If that works, use the browser to access http://localhost:8080/manage

Uninstalling

If you're experimenting with different scenarios described here and you want to remove this one without preserving any of the files installed or generated during your experimentation, here's a quick and easy way to do it.

  1. First, verify the list of RPMs we're going to remove doesn't contain anything we don't want to remove (the command is shown with the expected output below it):
                $ rpm -qa | grep -E "python2.1|Zope"
                Zope-zserver-2.5.1-1
                python2.1-2.1.3-1
                Zope-2.5.1-1
                python2.1-devel-2.1.3-1
    
  2. Assuming the output was kosher:
                $ cmd=`rpm -qa | grep -E "python2.1|Zope`
                $ for x in $cmd ; do sudo rpm -e --nodeps $x ; done
    
  3. Erase any remaining files:
                $ sudo rm -fR /usr/share/zope /var/zope
    
  4. Verify that erasing the RPMs actually removed the zope user account and removed the zope startup script from /etc/init.d. All of these should have empty output:
                $ grep -E "^zope" /etc/passwd /etc/group
                $ ls -l /etc/init.d/zope
                $ /sbin/chkconfig --list | grep zope
    

[scenario2]

Installation scenario 2: Source tarball, latest distributed release

Install Python

  1. Download the source tarball for Python 2.1.3 :
                $ cd /var/tmp
                $ wget http://www.python.org/ftp/python/2.1.3/Python-2.1.3.tgz
    
  2. Unpack the tarball:
                $ tar -zxvf Python-2.1.3.tgz
    
  3. Pick one of the configuration options (TODO: separate section with discussion) and configure Python:
                $ cd Python-2.1.3
    
                $ ./configure
                $ ./configure --with-threads --without-pymalloc
                $ CC='gcc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64'; ./configure
    
  4. Make, install:
                $ make
                $ sudo make altinstall
    

Install Zope

  1. Download the source distribution for Zope 2.5.1 :
                $ cd /var/tmp
                $ wget http://www.zope.org/Products/Zope/2.5.1/Zope-2.5.1-src.tgz
    
  2. Unpack the tarball:
                $ tar -zxvf Zope-2.5.1-src.tgz
    
  3. Move it to /usr/local and omit src from the name:
                $ sudo mv /var/tmp/Zope-2.5.1-src /usr/local/Zope-2.5.1
    
  4. Make a symbolic link for Zope:
                $ sudo ln -s /usr/local/Zope-2.5.1 /usr/local/zope
    
  5. Create zope user and group:
                $ sudo /usr/sbin/groupadd zope
                $ sudo /usr/sbin/useradd -M -g zope -s /sbin/nologin zope
    
  6. Make the zope user the owner of the /usr/local/zope directory:
                $ sudo chown -R zope:zope /usr/local/zope/.
    
  7. Build Zope:
                $ cd /usr/local/zope
                $ sudo -u zope python2.1 wo_pcgi.py
    
  8. Set the admin password:
                $ sudo -u zope python2.1 zpasswd.py -u admin -p 123 inituser
    

Install ZEO

  1. Download the latest version of ZEO (ZEO 2.0b1 as of this writing) :
                $ cd /var/tmp
                $ wget http://www.zope.org/Products/ZEO/ZEO-2.0b1.tar.gz
    
  2. Unpack the tarball:
                $ tar -zxvf ZEO-2.0b1.tar.gz
    
  3. Build it (TODO: Remove previous temp folders):
                $ cd ZEO
                $ export PYTHONPATH='/usr/local/zope/lib/python'
                $ python2.1 setup.py build
    
  4. Test it (the repetition of -v makes the output more verbose):
                $ python2.1 test.py -v -v
    
  5. Install it:

    $ sudo python2.1 setup.py install --home=/usr/local/zope

Configure ZEO

  1. There are two scripts that will make our lives easier: zeo_start [zeostart] and zeo_stop [zeostop]. Place a copy of these scripts in /usr/local/zope. Set the executable bit on these scripts:
                $ sudo chmod +x /usr/local/zope/zeo_st*
    
  2. Copy the StorageConfig.py [storageconfig] module to the ZEO directory (/usr/local/zope/lib/python/ZEO) to define the storage we're serving. Make sure you specify /usr/local/zope as the zope_path.
  3. Make the zope user the owner of everything within /usr/local/zope:
                $ sudo chown -R zope:zope /usr/local/zope/.
    

Start ZEO

To start ZEO, you merely need to run zeo_start:

            $ sudo /usr/local/zope/zeo_start

Stop ZEO

To stop ZEO, use zeo_stop:

            $ sudo /usr/local/zope/zeo_stop

Test ZEO

  1. Place a copy of test_zeo.py [testzeo] in /var/tmp.
  2. Run test_zeo.py. Open multiple terminal windows (e.g., 3) and start a copy of test_zeo.py in each of them:
                $ python2.1 /var/tmp/test_zeo.py 127.0.0.1 8800 main /usr/local/zope/lib/python
    

You should see something like this scroll across each screen:

            {'_pack_time': 925771972.67781401, 'Application': <Application instance at 855fd70>}

Configure Zope

  1. Make a backup of the original start script--we're going to change it:
                $ sudo cp /usr/local/zope/start /usr/local/zope/start.original
    
  2. Place a copy of the zope start file [zopestart] in /usr/local/zope/.
  3. Make sure the script is owned by the zope user and it's executable.
  4. Place a copy of the custom_zodb.py script [customzodb] in /usr/local/zope. Make sure you specify the correct zope path in the script.
  5. Make sure the zope user owns all the files in /usr/local/zope:
                $ sudo chown -R zope:zope /usr/local/zope/.
    
  6. Run the zpasswd.py script to set the administrative password to a known value (admin, 123):
                $ cd /usr/local/zope
                $ sudo -u zope python2.1 zpasswd.py -u admin -p 123 inituser
    

Start Zope

You can start Zope using the start script:

            $ sudo /usr/local/zope/start

Stop Zope

You can stop Zope using the stop script:

            $ sudo /usr/local/zope/stop

Test Zope

  1. Avoid browser quirks by trying to retrieve the root document directly from telnet:
                (echo -e "GET / HTTP/1.0\n\n"; sleep 5) | telnet 127.0.0.1 8080
    
  2. If that works, use the browser to access http://localhost:8080/manage

Uninstalling

  1. Remove Python 2.1.3:
                $ sudo rm -fR /usr/lib/python2.1 \
                       /usr/local/bin/python2.1 \
                       /usr/local/lib/python2.1 \
                       /usr/include/python2.1
    
  2. Remove Zope and ZEO:
                $ sudo rm -fR /usr/local/zope /usr/local/Zope-2.5.1
    
  3. Remove the zope user:
                $ sudo /usr/sbin/userdel zope
    

[scenario3]

Installation scenario 3: CVS

You can access the Zope CVS . You can use the cvs-zope [cvszope] script to make accessing Zope's CVS even easier.

Install Python

Use the same procedure as defined in scenario 2 [scenario2].

Install Zope

Decide which branch you want to use:
  • chrism-install-branch
  • Zope-2_5-branch

I haven't gotten the latter to work with ZEO yet, but I have gotten the former to work.

  1. Login to Zope's CVS [cvszope].
  2. Create a working directory:
                $ mkdir -p ~/proj/zope
    
  3. Get the branch you want--if you want to use the latest Zope HEAD, don't specify -r $branch_name option:
                $ cd ~/proj/zope
                $ cvs co -r $branch_name Zope
    
  4. Configure, make, make install. You may choose a different prefix and you may want to enable large file support. If you want large file support, you'll have to re-install Python 2.1.3. Here's what I did:
                $ cd Zope
                $ ./configure --prefix=/opt/zope --ignore-largefile
                $ make
                $ sudo make install
    
  5. Create the zope user and group:
                $ sudo /usr/sbin/groupadd -r zope
                $ sudo /usr/sbin/useradd -r -g zope -M -s /sbin/nologin zope
    
  6. Make the zope user the owner of /opt/zope:
                $ sudo chown -R zope:zope /opt/zope/.
    
  7. Make a directory for Zope instances separate from the software:
                $ sudo mkdir -p /opt/zope_instances/zope_1
    
  8. Make the zope user the owner of the zope_instances directory:
                $ sudo chown -R zope:zope /opt/zope_instances/.
    
  9. Make a Zope instance in zope_1:
                $ sudo -u zope /opt/zope/makeinstance
    
                Instance home [/opt/zope]: /opt/zope_instances/zope_1
                Username: admin
                Password: 123
    

Install ZEO

  1. Get the latest version of ZEO from CVS:
                $ cd ~/proj/zope
                $ cvs co ZEO
    
  2. Build ZEO:
                $ cd ZEO
                $ python2.1 setup.py build
    
  3. Test ZEO:
                $ export PYTHONPATH='/opt/zope/lib/python'
                $ python2.1 test.py -v -v
    
  4. Install ZEO:
                $ sudo python2.1 setup.py install --home=/opt/zope
    
  5. Make sure the zope owner owns all files in /opt/zope after installing ZEO:
                $ sudo chown -R zope:zope /opt/zope/.
    
  6. Modify /opt/zope_instances/zope_1/zope.conf. I modified the following direcives:
    • effective_user zope
    • ip_address 192.168.0.2
    • use_zeo_server on
    • zeo_storage_server_hostname 192.168.0.2
    • zeo_storage_server_path_or_port 8800

Start ZEO and Zope

The zctl script in the instance home allows you to start Zope and ZEO separately. If you start Zope and you're using ZEO but ZEO is not running, zctl will start ZEO for you. However, it seems like you have to run zctl from the instance home directory:

            $ cd /opt/zope_instances/zope_1
            $ sudo -u zope ./zctl start

TODO: Why doesn't it work starting as root (sudo ./zctl start)? Effective user control in Zope is problematic and is currently being overhauled.

[scenario4]

Installation scenario 4: Red Hat 7.2, ZEO 1, previous releases

TODO

Running ZEO with one Zope client on the same computer

TODO

Running ZEO with one Zope client on a different computer

TODO

Running ZEO with multiple Zope clients

TODO

Migrating from a standalone Zope server to ZEO

TODO

Managing a Zope client: Products, External Methods, etc.

TODO

Configuration issues

Security

How do you secure a ZEO server? The following snippet from the much outdated ZEOFactSheet suggests you can:

To support distribution to externally controlled Zope sites, the ZSS can restrict connections (1) by address, (2) require a security key, and/or (3) permit read-only access. These features make ZEO a good fit for the classic "Internet mirror".

[ref]

References

Here are the ZEO resources I have found useful:

  • HOWTOs on zope.org that refer to ZEO
  • The ZEO Product page
  • The Zope Book

    The Zope Book chapter on ZEO offers a grand overview of ZEO, but not much in the way of nitty gritty details on configuring and administering ZEO.

    There are two versions of the Zope Book that are relevant:

    Unfortunately, they both refer to ZEO 1.0.

  • Installation and Configuration Proposal

    This is a very promising proposal for consolidating all the Zope and ZEO configuration parameters into a single Apache-style configuration file. Unfortunately, it has several (not surprising) bugs in it and I don't know whether it will even be accepted, much less when it will be stable and usable as far as ZEO is concerned.

Useful scripts

TODO: Explain settings in each script.

[buildrpm]

This is the buildrpm script:

    #!/bin/bash

    if [ -z "$1" ] ; then
        echo "Usage: `basename $0` srpm"
        exit 1
    fi

    srpm=$1

    if [ ! -d $HOME/rpm ] ; then
        mkdir $HOME/rpm
        mkdir $HOME/rpm/SOURCES
        mkdir $HOME/rpm/SPECS
        mkdir $HOME/rpm/BUILD
        mkdir $HOME/rpm/SRPMS
        mkdir $HOME/rpm/RPMS
        mkdir $HOME/rpm/RPMS/i386
    fi

    if [ ! -f $HOME/.rpmmacros ] ; then
        echo "%_topdir $HOME/rpm" > $HOME/.rpmmacros
    fi

    rpmbuild --rebuild $srpm

xxx

[lfs]

This Python script performs a simplistic test for large file support. I have no idea whether the test is valid. This code is from the the Zope branch chrism-install-branch in the file $/Zope/inst/configure.py:

    # lfs.py
    import sys
    OK=0
    f = open(sys.argv[0], 'r')
    try:
        # 2**31 == 2147483648
        f.seek(2147483649L)
        f.close()
        OK=1
    except (IOError, OverflowError):
        f.close()
    if OK:
        print "large file support enabled"
    else:
        print "large file support not enabled"

xxx

[testzeo]

This Python script (based on code posted by Greg Ward) can be used to test access to ZEO without using Zope:

    #!/usr/bin/env python2.1

    import sys

    usage = "Usage: %s host port storage pythonpath"
    prog = sys.argv[0]
    try:
        host = sys.argv[1]
        port = int(sys.argv[2])
        storage_name = sys.argv[3]
        pythonpath = sys.argv[4]
    except IndexError:
        print usage % prog
        sys.exit(1)

    sys.path.insert(0, pythonpath)

    import time

    from pprint import pprint
    from ZEO.ClientStorage import ClientStorage
    from ZODB.DB import DB

    s = ClientStorage((host, port), storage=storage_name)
    db = DB(s)
    conn = db.open()

    # Pause 5 seconds.
    pause = 5

    while 1:
          pprint(conn.root())
          time.sleep(pause)

xxx

[zeostart]

This is the zeo_start file:

    #!/bin/sh

    reldir=`dirname $0`

    use_unix_sockets=0

    zope_user=zope
    port=8800
    host=127.0.0.1

    if [ $use_unix_sockets == 1 ] ; then
        socket_file=$reldir/var/zeo.soc
        if [ -S $socket_file ] ; then
            rm $socket_file
        fi
        exec python2.1 $reldir/lib/python/ZEO/start.py \
             -S main=StorageConfig:main_storage \
             -u $zope_user \
             -U $socket_file \
             ZEO_SERVER_PID=$reldir/var/ZEO_SERVER.pid \
             STUPID_LOG_FILE=$reldir/var/ZEO_EVENTS.log \
             "$@"
    else
        exec python2.1 $reldir/lib/python/ZEO/start.py \
             -S main=StorageConfig:main_storage \
             -u $zope_user \
             -p $port \
             -h $host \
             ZEO_SERVER_PID=$reldir/var/ZEO_SERVER.pid \
             STUPID_LOG_FILE=$reldir/var/ZEO_EVENTS.log \
             "$@"
    fi

xxx

[zeostop]

This is the zeo_stop file:

    #!/bin/sh

    reldir=`dirname $0`
    kill `cat $reldir/var/ZEO_SERVER.pid`

xxx

[storageconfig]

This is the StorageConfig.py module:

    import os
    zope_path = # You must specify this; e.g., /usr/share/zope
    storage_path = os.path.join(zope_path, "var", "Data.fs")

    import ZODB.FileStorage
    main_storage = ZODB.FileStorage.FileStorage(storage_path)

xxx

[zopestartrpm]

This is the zope start file for the RPM installation:

    #!/bin/sh
    export INSTANCE_HOME=/var/zope

    cd $INSTANCE_HOME
    /usr/bin/env python2.1 z2.py \
        -u zope \
        -z /usr/share/zope \
        -Z /var/run/zwatchdog.pid \
        -w 127.0.0.1:8080 \
        -f '' \
        -m '' \
        -l /var/log/zope \
        STUPID_LOG_FILE=/var/zope/zope_stupid.log \
        ZEO_CLIENT=8800 \
        FORCE_PRODUCT_LOAD=1 \
        >>      /var/log/zope 2>&1 \
        &

xxx

... [customzodb]

This is the custom_zodb.py module:

    import os
    zope_path = # You must specify this; e.g., /usr/share/zope
    socket_file = os.path.join(zope_path, "var", "zeo.soc")

    use_unix_sockets = 0

    zeo_server = "127.0.0.1"
    port = 8800

    storage_name = "main"

    from ZEO.ClientStorage import ClientStorage

    if use_unix_sockets:
        Storage = ClientStorage(socket_file, storage=storage_name)
    else:
        Storage = ClientStorage((zeo_server, port), storage=storage_name)

xxx

[zopestart]

This is the Zope start script for a source install:

    #! /bin/sh
    reldir=`dirname $0`
    INST_HOME=`cd $reldir; pwd`
    STUPID_LOG_FILE=$reldir/var/ZOPE_EVENTS.log
    PYTHONPATH=$reldir/lib/python
    export INST_HOME
    export STUPID_LOG_FILE
    export PYTHONPATH
    exec python2.1           \
        $INST_HOME/z2.py     \
        -u zope              \
        -w 127.0.0.1:8080    \
        -f ''                \
        -m ''                \
        -l /var/log/zope     \
        ZEO_CLIENT=8800      \
        FORCE_PRODUCT_LOAD=1 \
        "$@"

xxx

[cvszope]

I place this script in a directory that's on the $PATH so that I can access easily access Zope's CVS:

    #!/bin/bash

    CVSROOT=:pserver:anonymous@cvs.zope.org:/cvs-repository
    export CVSROOT

    cvs login
    bash -login