- B>csdZdkZdkZdkZdkZdZdZdZdZdZ dfdYZ d Z d Z d Z d Zd ZdZedjo e ndS(s%(program)s -- create a ZEO instance. Usage: %(program)s home [port] Given an "instance home directory" and some configuration options (all of which have default values), create the following: /etc/zeo.conf -- ZEO config file /etc/zeoctl.conf -- zdctl+zdrun config file /var/ -- Directory for data files: Data.fs etc. /log/ -- Directory for log files: zeo.log and zeoctl.log /bin/runzeo -- the zeo server runner /bin/zeoctl -- start/stop script (a shim for zdctl.py) The script will not overwrite existing files; instead, it will issue a warning if an existing file is found that differs from the file that would be written if it didn't exist. Nsq# ZEO configuration file %%define INSTANCE_HOME %(instance_home)s address %(port)d read-only false invalidation-queue-size 100 # monitor-address PORT # transaction-timeout SECONDS path $INSTANCE_HOME/var/Data.fs level info path $INSTANCE_HOME/log/zeo.log s# %(package)sctl configuration file %%define INSTANCE_HOME %(instance_home)s program $INSTANCE_HOME/bin/runzeo socket-name $INSTANCE_HOME/etc/%(package)s.zdsock daemon true forever false backoff-limit 10 exit-codes 0, 2 directory $INSTANCE_HOME default-to-interactive true # user zope python %(python)s zdrun %(zope_home)s/zdaemon/zdrun.py # This logfile should match the one in the %(package)s.conf file. # It is used by zdctl's logtail command, zdrun/zdctl doesn't write it. logfile $INSTANCE_HOME/log/%(package)s.log level info path $INSTANCE_HOME/log/%(package)sctl.log sc#!/bin/sh # %(PACKAGE)s instance start script # The following two lines are for chkconfig. On Red Hat Linux (and # some other systems), you can copy or symlink this script into # /etc/rc.d/init.d/ and then run chkconfig(8), to automatically start # %(PACKAGE)s at boot time. # chkconfig: 345 90 10 # description: start a %(PACKAGE)s server PYTHON="%(python)s" ZOPE_HOME="%(zope_home)s" INSTANCE_HOME="%(instance_home)s" CONFIG_FILE="$INSTANCE_HOME/etc/%(package)sctl.conf" PYTHONPATH="$ZOPE_HOME" export PYTHONPATH ZDCTL="$ZOPE_HOME/zdaemon/zdctl.py" exec "$PYTHON" "$ZDCTL" -C "$CONFIG_FILE" ${1+"$@"} s8#!/bin/sh # %(PACKAGE)s instance start script PYTHON="%(python)s" ZOPE_HOME="%(zope_home)s" INSTANCE_HOME="%(instance_home)s" CONFIG_FILE="$INSTANCE_HOME/etc/%(package)s.conf" PYTHONPATH="$ZOPE_HOME" export PYTHONPATH ZEO_RUN="$ZOPE_HOME/ZEO/runzeo.py" exec "$PYTHON" "$ZEO_RUN" -C "$CONFIG_FILE" ${1+"$@"} cstidGHdS(Ns All done.(sZEOInstanceBuildersrun(((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pysmains sZEOInstanceBuildercs#tZdZdZdZRS(Nc sy)titidddg\}}Wn*tij o}|GHtidnXti i tid}|o&t h|d<}|GHtint |ddgjod|GHtidn|d}ti i| oti i|}nxPti D]3}ti iti i|do |} Pnq Wd GHtid|dot|d}nd }t||i| ||}|i||dS( NishshelpiisprogramsUsage: %s home [port]sZopes*Can't find the Zope home (not in sys.path)i'(sgetoptssyssargvsoptssargsserrorsmsgsexitsosspathsbasenamesprograms__doc__slens instance_homesisabssabspathsentrysexistssjoins zope_homesintsports checkportsselfs get_paramssparamsscreate( sselfsargssportsprograms instance_homesparamssentrysmsgsoptss zope_home((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pysruns:)   "    csAhdd<dd<|d<|d<|d<tidd}x#|D]}tii||}q Wt||SdS(Ns(spathsargssargsossjoinsmkdirs(sargsspathsarg((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pysmakedirs  cs}tii|odSntii|\}}|o|otii| ot|nti|dG|GHdS(NsCreated directory(sosspathsisdirssplitsheadstailsmkdirssmkdir(spathsheadstail((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pysmkdirss" cst|d }tii||d}||}tii|o[t |}|i i }|i|o(||i jo d|GHn|Snnt |d}|i||idG|GH|SdS(Nis)Warning: not overwriting existing file %rsws Wrote file(smakedirsargsspathsossjoinstemplateskwdssdatasexistssopensfsreadsstripsolddatascloseswrite(stemplatesargsskwdssolddatasfspathsdata((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pysmakefiles         cst|||}tid}ti|d|@}ti ti|ti |jo#ti ||d||fGHn|SdS(NiisChanged mode for %s to %o( smakefilestemplatesargsskwdsspathsossumasksmodesstatsS_IMODEsST_MODEschmod(stemplatesargsskwdsspathsmodesumask((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys makexfiles  &s__main__(s__doc__sosssyssstatsgetoptszeo_conf_templatesrunner_conf_templateszdctl_templatesrunzeo_templatesmainsZEOInstanceBuilders checkportswhichsmakedirsmkdirssmakefiles makexfiles__name__(srunner_conf_templateszdctl_templatesstatszeo_conf_templates checkportsmakedirsmakefilesmkdirsssyssZEOInstanceBuilderswhichs makexfilesgetoptsmainsossrunzeo_template((s5/usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys? s$     <