Working ZEO server startup script for current ZEO (5.1.0)

Jens Vagelpohl <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
Hi all,

Does anyone have a buildout example snippet that generates a working script to start/stop a standalone ZEO server under ZEO 5.1.0? As already mentioned on the list, the old script generating recipes such as plone.recipe.zeoserver and the zope.mkzeoinstance script no longer work.

As an example, here’s the traceback from a current (v. 1.3.1) plone.recipe.zeoserver-generated script:

$ bin/zeoserver fg
/opt/zope/buildout/parts/zeoserver/bin/runzeo
Traceback (most recent call last):
 File "/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg/ZEO/runzeo.py", line 401, in <module>
   main()
 File "/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg/ZEO/runzeo.py", line 392, in main
   s.main()
 File "/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg/ZEO/runzeo.py", line 155, in main
   self.create_server()
 File "/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg/ZEO/runzeo.py", line 251, in create_server
   self.server = create_server(self.storages, self.options)
 File "/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg/ZEO/runzeo.py", line 345, in create_server
   from .StorageServer import StorageServer
ValueError: Attempted relative import in non-package

bin/zeoserver looks like this:

“””
#!/opt/zope/Python-2.7.13/bin/python2.7

import sys
sys.path[0:0] = [
 '/opt/zope/buildout/eggs/plone.recipe.zeoserver-1.3.1-py2.7.egg',
 '/opt/zope/buildout/eggs/ZopeUndo-4.1-py2.7.egg',
 '/opt/zope/buildout/eggs/ZODB3-3.11.0-py2.7.egg',
 '/opt/zope/buildout/eggs/zope.mkzeoinstance-3.9.5-py2.7.egg',
 '/opt/zope/buildout/eggs/zc.recipe.egg-2.0.3-py2.7.egg',
 '/opt/zope/buildout/eggs/setuptools-34.3.0-py2.7.egg',
 '/opt/zope/buildout/eggs/zc.buildout-2.8.0-py2.7.egg',
 '/opt/zope/buildout/eggs/transaction-2.1.2-py2.7.egg',
 '/opt/zope/buildout/eggs/BTrees-4.4.1-py2.7-linux-x86_64.egg',
 '/opt/zope/buildout/eggs/persistent-4.2.4-py2.7-linux-x86_64.egg',
 '/opt/zope/buildout/eggs/ZODB-5.2.0-py2.7.egg',
 '/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg',
 '/opt/zope/buildout/eggs/appdirs-1.4.3-py2.7.egg',
 '/opt/zope/buildout/eggs/six-1.10.0-py2.7.egg',
 '/opt/zope/buildout/eggs/packaging-16.8-py2.7.egg',
 '/opt/zope/buildout/eggs/zope.interface-4.2.0-py2.7-linux-x86_64.egg',
 '/opt/zope/buildout/eggs/zodbpickle-0.6.0-py2.7-linux-x86_64.egg',
 '/opt/zope/buildout/eggs/zc.lockfile-1.0.2-py2.7.egg',
 '/opt/zope/buildout/eggs/ZConfig-3.1.0-py2.7.egg',
 '/opt/zope/buildout/eggs/trollius-2.1-py2.7.egg',
 '/opt/zope/buildout/eggs/futures-3.0.5-py2.7.egg',
 '/opt/zope/buildout/eggs/zdaemon-4.2.0-py2.7.egg',
 '/opt/zope/buildout/eggs/pyparsing-2.2.0-py2.7.egg',
 ]

import os; os.environ['PYTHONPATH'] = '/opt/zope/buildout/eggs/plone.recipe.zeoserver-1.3.1-py2.7.egg:/opt/zope/buildout/eggs/ZopeUndo-4.1-py2.7.egg:/opt/zope/buildout/eggs/ZODB3-3.11.0-py2.7.egg:/opt/zope/buildout/eggs/zope.mkzeoinstance-3.9.5-py2.7.egg:/opt/zope/buildout/eggs/zc.recipe.egg-2.0.3-py2.7.egg:/opt/zope/buildout/eggs/setuptools-34.3.0-py2.7.egg:/opt/zope/buildout/eggs/zc.buildout-2.8.0-py2.7.egg:/opt/zope/buildout/eggs/transaction-2.1.2-py2.7.egg:/opt/zope/buildout/eggs/BTrees-4.4.1-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/persistent-4.2.4-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/ZODB-5.2.0-py2.7.egg:/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg:/opt/zope/buildout/eggs/appdirs-1.4.3-py2.7.egg:/opt/zope/buildout/eggs/six-1.10.0-py2.7.egg:/opt/zope/buildout/eggs/packaging-16.8-py2.7.egg:/opt/zope/buildout/eggs/zope.interface-4.2.0-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/zodbpickle-0.6.0-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/zc.lockfile-1.0.2-py2.7.egg:/opt/zope/buildout/eggs/ZConfig-3.1.0-py2.7.egg:/opt/zope/buildout/eggs/trollius-2.1-py2.7.egg:/opt/zope/buildout/eggs/futures-3.0.5-py2.7.egg:/opt/zope/buildout/eggs/zdaemon-4.2.0-py2.7.egg:/opt/zope/buildout/eggs/pyparsing-2.2.0-py2.7.egg:’

import plone.recipe.zeoserver.ctl

if __name__ == '__main__':
   sys.exit(plone.recipe.zeoserver.ctl.main(
       ["-C", '/opt/zope/buildout/parts/zeoserver/etc/zeo.conf']
       + sys.argv[1:]))
“””

/opt/zope/buildout/parts/zeoserver/bin/runzeo looks like this:

“””
#!/bin/sh
# ZEO instance start script

PYTHON="/opt/zope/Python-2.7.13/bin/python2.7"
INSTANCE_HOME="/opt/zope/buildout/parts/zeoserver"
ZODB3_HOME="/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg"

CONFIG_FILE="/opt/zope/buildout/parts/zeoserver/etc/zeo.conf"

PYTHONPATH="/opt/zope/buildout/eggs/plone.recipe.zeoserver-1.3.1-py2.7.egg:/opt/zope/buildout/eggs/ZopeUndo-4.1-py2.7.egg:/opt/zope/buildout/eggs/ZODB3-3.11.0-py2.7.egg:/opt/zope/buildout/eggs/zope.mkzeoinstance-3.9.5-py2.7.egg:/opt/zope/buildout/eggs/zc.recipe.egg-2.0.3-py2.7.egg:/opt/zope/buildout/eggs/setuptools-34.3.0-py2.7.egg:/opt/zope/buildout/eggs/zc.buildout-2.8.0-py2.7.egg:/opt/zope/buildout/eggs/transaction-2.1.2-py2.7.egg:/opt/zope/buildout/eggs/BTrees-4.4.1-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/persistent-4.2.4-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/ZODB-5.2.0-py2.7.egg:/opt/zope/buildout/eggs/ZEO-5.1.0-py2.7.egg:/opt/zope/buildout/eggs/appdirs-1.4.3-py2.7.egg:/opt/zope/buildout/eggs/six-1.10.0-py2.7.egg:/opt/zope/buildout/eggs/packaging-16.8-py2.7.egg:/opt/zope/buildout/eggs/zope.interface-4.2.0-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/zodbpickle-0.6.0-py2.7-linux-x86_64.egg:/opt/zope/buildout/eggs/zc.lockfile-1.0.2-py2.7.egg:/opt/zope/buildout/eggs/ZConfig-3.1.0-py2.7.egg:/opt/zope/buildout/eggs/trollius-2.1-py2.7.egg:/opt/zope/buildout/eggs/futures-3.0.5-py2.7.egg:/opt/zope/buildout/eggs/zdaemon-4.2.0-py2.7.egg:/opt/zope/buildout/eggs/pyparsing-2.2.0-py2.7.egg:"
export PYTHONPATH INSTANCE_HOME

RUNZEO="$ZODB3_HOME/ZEO/runzeo.py"

exec "$PYTHON" "$RUNZEO" -C "$CONFIG_FILE" ${1+"$@“}
“””

Thanks for any help!

jens



-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
signature.asc (application/pgp-signature, 801 B)
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJY90lNAAoJEMG3TVmYpfZX+vMP/25hkNNCDr5XfDT37LbQHGaF
Vt8ImwtAtdCQi/RzURmj5mTyDaJ11hjx5jRK+Hu5j5Z8Q0HiF4dHsM/xDTRtESmt
H4LEJ3XjqqmxLiYOnz2nF4BtmNjwwcore72Z+5acF4DwKMRIlJF7BnjqKohuak2q
jlWAw3Iwe3XvIizr/g5xn5JKkDv8Kw/z8w0nXriC7XH3KaDfUqHW+d9tcuGj4lpM
SWqF7Dyl0qAKE5CmO+wAYNaZgrqoVtqNn75TdFeFsTje/7cIA+n2ikd/Ip5gwdzn
As52KsZtECIa8Ep56IPNaXpoEf3ILRzhcw7+8q3QY6ceXWat5QVal0eKIsJojQGO
uvIvs+Bf/Nae8y79y1n4oJgv1PCLJIOPRhuU9KuGtelVzN3309caW1hC6P3nAvAI
upznQaWyUkZFekkL5vKQ+Eik/JwYH/0vXzYW44SbUj6Lb7QU9xCGD43oI2QjYsjt
yFhEagiNNHnBkWyO5VydFHTFwh4VO8srSDIA9//sia3zbC04S/v3FNzmM5yPbIxD
FA7Jq+p+3MEvSE8Imd/T7Mhmf0JhNuBQpfe6jBs27Uyi3EeHBUDnzNGND1F02ssh
7Ag6zQ0U7rYOwXyL5Ned3+VT67RRd1RJxa8iLTsRxasTAiUxRHUQrRmD5gsrYU9d
niCZ+fu/AmxKaxj4CYJq
=x9tN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.