-í
‹š™?c       sª   d  Z  d k Z d k Z d k Z d k Z d Z d Z d Z d „  Z d f  d „  ƒ  YZ	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z e d j o e ƒ  n d S(   sª  %(program)s -- create a ZEO instance.

Usage: %(program)s home [port]

Given an "instance home directory" <home> and some configuration
options (all of which have default values), create the following:

<home>/etc/zeo.conf     -- ZEO config file
<home>/var/             -- Directory for data files: Data.fs etc.
<home>/log/             -- Directory for log files: zeo.log and zeoctl.log
<home>/bin/runzeo       -- the zeo server runner
<home>/bin/zeoctl       -- start/stop script (a shim for zeoctl.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.
Ns:  # ZEO configuration file

%%define INSTANCE %(instance_home)s

<zeo>
  address %(port)d
  read-only false
  invalidation-queue-size 100
  # monitor-address PORT
  # transaction-timeout SECONDS
</zeo>

<filestorage 1>
  path $INSTANCE/var/Data.fs
</filestorage>

<eventlog>
  level info
  <logfile>
    path $INSTANCE/log/zeo.log
  </logfile>
</eventlog>

<runner>
  program $INSTANCE/bin/runzeo
  socket-name $INSTANCE/etc/%(package)s.zdsock
  daemon true
  forever false
  backoff-limit 10
  exit-codes 0, 2
  directory $INSTANCE
  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/log/%(package)s.log
</runner>
sA  #!/bin/sh
# %(PACKAGE)s instance control 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 use 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"

CONFIG_FILE="%(instance_home)s/etc/%(package)s.conf"

PYTHONPATH="$ZOPE_HOME"
export PYTHONPATH

ZEOCTL="$ZOPE_HOME/ZEO/zeoctl.py"

exec "$PYTHON" "$ZEOCTL" -C "$CONFIG_FILE" ${1+"$@"}
s  #!/bin/sh
# %(PACKAGE)s instance start script

PYTHON="%(python)s"
ZOPE_HOME="%(zope_home)s"

CONFIG_FILE="%(instance_home)s/etc/%(package)s.conf"

PYTHONPATH="$ZOPE_HOME"
export PYTHONPATH

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

exec "$PYTHON" "$RUNZEO" -C "$CONFIG_FILE" ${1+"$@"}
c      s   t  ƒ  i ƒ  d GHd  S(   Ns	   All done.(   s   ZEOInstanceBuilders   run(    (    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   main~ s    s   ZEOInstanceBuilderc      s#   t  Z d „  Z d „  Z d „  Z RS(   Nc 
   s®  y) t  i  t i d d d g ƒ \ } } Wn* t  i j
 o } | GHt i d ƒ n Xt i	 i
 t i d ƒ } | o& t h  | d <} | GHt i ƒ  n t | ƒ d d g j o d | GHt i d ƒ n | d } t i	 i | ƒ o t i	 i | ƒ } n xP t i	 D]3 } t i	 i t i	 i | d ƒ ƒ o | }	 Pn qWd	 GHt i d ƒ | d o t | d ƒ } n d
 } t | ƒ |  i |	 | | ƒ } |  i | | ƒ d  S(   Ni   s   hs   helpi   i    s   programs   Usage: %s home [port]s   Zopes*   Can't find the Zope home (not in sys.path)i'  (   s   getopts   syss   argvs   optss   argss   errors   msgs   exits   oss   paths   basenames   programs   __doc__s   lens   instance_homes   isabss   abspaths   entrys   existss   joins	   zope_homes   ints   ports	   checkports   selfs
   get_paramss   paramss   create(
   s   selfs   argss   ports   programs   instance_homes   paramss   entrys   msgs   optss	   zope_home(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   runƒ s:    )	

 "	
c    sA   h  d d <d d <| d <| d <| d <t i d <Sd  S(	   Ns   zeos   packages   ZEOs   PACKAGEs	   zope_homes   instance_homes   ports   python(   s	   zope_homes   instance_homes   ports   syss
   executable(   s   selfs	   zope_homes   instance_homes   port(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys
   get_params¨ s    c    s„   t  | ƒ t  | d ƒ t  | d ƒ t  | d ƒ t  | d ƒ t t | d d |  t t | d d |  t t | d d |  d  S(   Ns   etcs   vars   logs   bins   zeo.confs   zeoctls   runzeo(   s   makedirs   homes   makefiles   zeo_conf_templates   paramss	   makexfiles   zeoctl_templates   runzeo_template(   s   selfs   homes   params(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   create² s    
(   s   __name__s
   __module__s   runs
   get_paramss   create(    (    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   ZEOInstanceBuilder‚ s   	%	
c    su   d  k  } | i  | i | i ƒ } y | i d |  f ƒ Wn, | i j
 o d |  GHt i d ƒ n X| i	 ƒ  d  S(   Ns    s)   A process is already listening on port %di   (
   s   sockets   AF_INETs   SOCK_STREAMs   ss   binds   ports   errors   syss   exits   close(   s   ports   ss   socket(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys	   checkport½ s    		c    s¹   t  i d ƒ } | i t  i ƒ } x~ | D]v } t  i i | |  ƒ } t  i i
 | ƒ o t  i | t  i ƒ o2 t  i i | ƒ o t  i i | ƒ } n | Sn q( Wt d |  | f ‚ d  S(   Ns   PATHs   can't find %r on path %r(   s   oss   getenvs   strpaths   splits   pathseps   binpaths   dirs   paths   joins   programs   isfiles   accesss   X_OKs   isabss   abspaths   IOError(   s   programs   binpaths   paths   dirs   strpath(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   whichÇ s     )c     s>   d } x# |  D] } t i  i | | ƒ } q Wt | ƒ | Sd  S(   Ns    (   s   paths   argss   args   oss   joins   mkdirs(   s   argss   paths   arg(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   makedirÒ s     
c    s}   t  i i |  ƒ o d  Sn t  i i |  ƒ \ } } | o | o t  i i | ƒ o t | ƒ n t  i |  ƒ d G|  GHd  S(   Ns   Created directory(   s   oss   paths   isdirs   splits   heads   tails   mkdirss   mkdir(   s   paths   heads   tail(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   mkdirsÙ s    "c    sØ   t  | d  Œ  } t i i | | d ƒ } |  | } t i i | ƒ o[ t	 | ƒ } | i ƒ  i ƒ  } | i ƒ  | o( | | i ƒ  j o d | GHn | Sn n t	 | d ƒ } | i | ƒ | i ƒ  d G| GH| Sd  S(   Niÿÿÿÿs)   Warning: not overwriting existing file %rs   ws
   Wrote file(   s   makedirs   argss   paths   oss   joins   templates   kwdss   datas   existss   opens   fs   reads   strips   olddatas   closes   write(   s   templates   argss   kwdss   olddatas   fs   paths   data(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   makefileâ s     


	c    sŠ   t  |  | | Ž } t i d ƒ } t i | ƒ d | @} t i	 t i | ƒ t i
 ƒ | j o# t i | | ƒ d | | f GHn | Sd  S(   Ni   iÿ  s   Changed mode for %s to %o(   s   makefiles   templates   argss   kwdss   paths   oss   umasks   modes   stats   S_IMODEs   ST_MODEs   chmod(   s   templates   argss   kwdss   paths   modes   umask(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys	   makexfileô s    &s   __main__(   s   __doc__s   oss   syss   stats   getopts   zeo_conf_templates   zeoctl_templates   runzeo_templates   mains   ZEOInstanceBuilders	   checkports   whichs   makedirs   mkdirss   makefiles	   makexfiles   __name__(   s   stats   zeo_conf_templates	   checkports   makedirs   makefiles   mkdirss   syss   ZEOInstanceBuilders   zeoctl_templates   whichs	   makexfiles   getopts   mains   oss   runzeo_template(    (    s5   /usr/pkg/lib/python2.2/site-packages/ZEO/mkzeoinst.pys   ? s"   				+	;	
						
