[ZODB-Dev] Possible To Start ZEO Via Script?
Christian Reis
kiko@async.com.br
Tue, 4 Feb 2003 09:58:06 -0200
On Tue, Feb 04, 2003 at 10:19:09AM +0000, John Abel wrote:
>
> Is it possible to have a script start up ZEO, instead of using
> ZEO/start.py? I have a script, that makes use of ZEO/ZODB, and I wanted
> the script to start ZEO as it started.
Sure; after all, what is start.py itself?
Just instantiate a StorageServer with the correct parameters and run
asyncore.loop(). Something like this works:
# Storages should be in a dictionary
storages = {'main' : FileStorage("FOO.fs") }
address = ('localhost', 4000)
server = StorageServer(address, storages)
asyncore.loop()
I've got a version implemented of a short script that takes
start/stop/status arguments, and when Johan gets back I'll ask him if
he's okay with sharing it. At any rate all it does is handle the
arguments and fork(). But why don't you use the scripts that come with
ZEO itself?
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL