The ZEO Server start script, start.py

  ZEO provides a Python script for starting the ZEO server.  The ZEO
  server is implemented as a Python class and could be used with other
  main programs, however, a simple ZEO server is provided for convenience.

  Basic usage

    To start the storage server, go to your Zope install directory and::

      python lib/python/ZEO/start.py -p port_number

    (Run start without arguments to see options.)

    Of course, the server and the client don't have to be on the same
    machine.

    If the server and client *are* on the same machine, then you can use 
    a Unix domain socket::

      python lib/python/ZEO/start.py -U filename

  Serving custom storages or multiple storages with the storage server

    The Storage server can host multiple storages and can
    host any kind of storage. Each storage has a unique storage
    name.  By default, the ZEO start.py script serves a 
    standard FileStorage with the name '1'.

    You can control what storages are served by creating a Python
    file containing definitions for the storages and using the '-S'
    option to the start.py script to indicate the storage
    to be served. The form of the -S option is::

       -Sstorage_name=module_path:attribute_name

    Where:

	storage_name -- is the storage name used in the ZEO protocol.
	   This is the name that you give as the optional
	   'storage' keyword argument to the ClientStorage constructor.

	module_path -- This is the path to a Python module
	   that defines the storage object(s) to be served.
	   The module path should ommit the prefix (e.g. '.py').

	attribute_name -- This is the name to which the storage object
	  is assigned in the module.


    Consider the following example. I want to serve a FileStorage
    in read-only mode, which I define in the module file 
    /stores/fs.py::

      import ZODB.FileStorage
      Storage=FileStorage.FileStorage('/stores/fs1.fs', read_only=1)

    I then start start.py with the argument::

      python lib/python/ZEO/start.py -U /xxx/var/zeo.sock \
        -S 1=/stores/fs:Storage

    This option says to serve storage '1'. Storage '1' is
    found in attribute 'Storage' from the module
    '/stores/fs'.

    Now consider a more complicated example. I want to serve the storage
    from the previous example. I also want to serve two Oracle
    storages that are defined in the file '/stores/oracle.py'::

      import DCOracle, DCOracleStorage
      system=DCOracleStorage.DCOracleStorage(
        lambda : DCOracle.Connect('system/manager@spamservice')
        )
      scott=DCOracleStorage.DCOracleStorage(
        lambda : DCOracle.Connect('scott/tiger@spamservice')
        )

    I simply need to include three -S options::

      python lib/python/ZEO/start.py -U /xxx/var/zeo.sock \
        -Ssystem=/stores/oracle:system                 \
        -Sscott=/stores/oracle:scott                   \
        -S1=/stores/fs:Storage

    In this case, we made the storage and attribute name the
    same. To connect to the 'system' or 'scott' storage, we
    need to specify the storage in the ClientStorage constructor, as
    in::

      import ZEO.ClientStorage
      Storage=ZEO.ClientStorage.ClientStorage(
          '/xxx/var/zeo.sock', storage='scott')

  Options

    The ZEO server start script is run with one or more command line
    options. An optional FileStorage file name may be provided after the
    options. The options are as follows:

     -D -- Run in debug mode

	In debug mode, the process is not run in the background
	and detailed debugging information is logged. 

	Note that to actually log this information, you need to
	configure logging to include very low-severity (< -300) log
	entries. For example, to configure the stupid logger to log
	these messages, set the environment veriable
	'STUPID_LOG_SEVERITY' to -999.

     -U -- Unix-domain socket file to listen on

	If you want to accept connections on a Unix domain socket, then
	use this option to specify the socket file name.

     -u username or uid number

       The username to run the ZEO server as. You may want to run
       the ZEO server as 'zope' or some other user with limited
       resouces. The only works under Unix, and if ZServer is
       started by root.

       If the server *is* started as root, the 'nobody' user if this
       option isn't used.

     -p port -- port to listen on

       Use this option together with the '-h' option to specify a host
       and port to listen on.

     -h adddress -- host address to listen on

       Use this option together with the '-p' option to specify a host
       and port to listen on.

     -s -- Don't use zdeamon

       This option has no effect on Unix.

     -S storage_name=module_path:attr_name -- A storage specification

	where:

	  storage_name -- is the storage name used in the ZEO protocol.
	     This is the name that you give as the optional
	     'storage' keyword argument to the ClientStorage constructor.

	  module_path -- This is the path to a Python module
	     that defines the storage object(s) to be served.
	     The module path should ommit the prefix (e.g. '.py').

	  attr_name -- This is the name to which the storage object
	    is assigned in the module.



