[Repoze-checkins] r679 - in repoze.grok/trunk: . repoze/grok/scripts repoze/grok/skel

Chris McDonough chrism at agendaless.com
Thu Feb 7 05:52:06 UTC 2008


Author: Chris McDonough <chrism at agendaless.com>
Date: Thu Feb  7 00:52:06 2008
New Revision: 679

Log:
    - mkgrokinstance now:

      o creates a "log" directory

      o writes out a zeo.conf into "etc"

    - Add a sample <zodb_db main> section to the generated zope.conf
      that can be uncommented if using ZEO is desirable.




Added:
   repoze.grok/trunk/repoze/grok/skel/sample-zeo.conf
Modified:
   repoze.grok/trunk/CHANGES.txt
   repoze.grok/trunk/README.txt
   repoze.grok/trunk/repoze/grok/scripts/initialize.py
   repoze.grok/trunk/repoze/grok/skel/sample-zope.conf

Modified: repoze.grok/trunk/CHANGES.txt
==============================================================================
--- repoze.grok/trunk/CHANGES.txt	(original)
+++ repoze.grok/trunk/CHANGES.txt	Thu Feb  7 00:52:06 2008
@@ -1,5 +1,16 @@
 repoze.grok Changelog
 
+  Next release
+
+    - mkgrokinstance now:
+
+      o creates a "log" directory
+
+      o writes out a zeo.conf into "etc"
+
+    - Add a sample <zodb_db main> section to the generated zope.conf
+      that can be uncommented if using ZEO is desirable.
+
   repoze.grok 0.1.5 (2007-2-5)
 
     - Install a mkgrokinstance script as a console script to support

Modified: repoze.grok/trunk/README.txt
==============================================================================
--- repoze.grok/trunk/README.txt	(original)
+++ repoze.grok/trunk/README.txt	Thu Feb  7 00:52:06 2008
@@ -140,4 +140,8 @@
   It's suggested that you serve up repoze.grok with mod_wsgi in
   "daemon mode" where each if the mod_wsgi's daemon children runs a
   single-threaded Zope process.  All of the Zope processes should
-  communicate with a single ZEO server on the back end.
+  communicate with a single ZEO server on the back end.  You can run a
+  ZEO server by invoking "bin/zeoctl start -C etc/zeo.conf" from
+  within a Repoze sandbox.  You'll need to change etc/zope.conf,
+  uncommenting the <zodb_db> section that refers to a client storage
+  at that point for Zope to work.

Modified: repoze.grok/trunk/repoze/grok/scripts/initialize.py
==============================================================================
--- repoze.grok/trunk/repoze/grok/scripts/initialize.py	(original)
+++ repoze.grok/trunk/repoze/grok/scripts/initialize.py	Thu Feb  7 00:52:06 2008
@@ -36,21 +36,33 @@
     etc = os.path.join(sandbox, 'etc')
     var = os.path.join(sandbox, 'var')
     bin = os.path.join(sandbox, 'bin')
+    log = os.path.join(sandbox, 'log')
 
-    for directory in etc, var, bin:
+    for directory in etc, var, bin, log:
         if not os.path.exists(directory):
             os.makedirs(directory)
 
+    try:
+        # this is (stupidly) required by the zdrun key in the <runner>
+        # section of zeo.conf
+        import zdaemon
+        zdaemon_pkgdir = zdaemon.__path__[0]
+    except ImportError:
+        zdaemon_pkgdir = '{unknown}'
+
     for source, target in (
         ('sample-grok.ini', 'grok.ini'),
         ('sample-site.zcml', 'site.zcml'),
         ('sample-zope.conf', 'zope.conf'),
         ('sample-apache2.conf', 'apache2.conf'),
         ('sample-users.zcml', 'sample-users.zcml'),
+        ('sample-zeo.conf', 'zeo.conf'),
         ):
 
         template = open(os.path.join(skel, source), 'r').read()
-        result = rewrite(template, sandbox=sandbox)
+        result = rewrite(template, sandbox=sandbox,
+                         zdaemon_pkgdir=zdaemon_pkgdir,
+                         python=sys.executable)
         targetfile = os.path.join(etc, target)
 
         if not os.path.exists(targetfile):
@@ -77,5 +89,5 @@
     if len(args) != 2:
         parser.print_help(sys.stderr)
         sys.exit(1)
-    path = os.path.realpath(args[1])
+    path = os.path.realpath(os.path.expanduser(args[1]))
     mkgrokinstance(path)

Added: repoze.grok/trunk/repoze/grok/skel/sample-zeo.conf
==============================================================================
--- (empty file)
+++ repoze.grok/trunk/repoze/grok/skel/sample-zeo.conf	Thu Feb  7 00:52:06 2008
@@ -0,0 +1,40 @@
+# Repoze ZEO configuration file
+
+%define INSTANCE ${sandbox}
+
+<zeo>
+  address 8100
+  read-only false
+  invalidation-queue-size 100
+  pid-filename $INSTANCE/var/ZEO.pid
+  # 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/var/zeo.zdsock
+  daemon true
+  forever false
+  backoff-limit 10
+  exit-codes 0, 2
+  directory $INSTANCE
+  default-to-interactive true
+  # user zope
+  python ${python}
+  zdrun ${zdaemon_pkgdir}/zdrun.py
+  # This logfile should match the one in the zeo.conf file.
+  # It is used by zdctl's logtail command, zdrun/zdctl doesn't write it.
+  logfile $INSTANCE/log/zeo.log
+</runner>

Modified: repoze.grok/trunk/repoze/grok/skel/sample-zope.conf
==============================================================================
--- repoze.grok/trunk/repoze/grok/skel/sample-zope.conf	(original)
+++ repoze.grok/trunk/repoze/grok/skel/sample-zope.conf	Thu Feb  7 00:52:06 2008
@@ -17,3 +17,16 @@
     path $INSTANCE/var/Data.fs
   </filestorage>
 </zodb>
+
+# Uncomment this to use a ZEO server as the main storage.
+#
+# <zodb>
+#   cache-size 10000
+#   <zeoclient>
+#     server localhost:8100
+#     storage 1
+#     cache-size 100MB
+#     name zeostorage
+#     var $INSTANCE/var
+#   </zeoclient>
+# </zodb>


More information about the Repoze-checkins mailing list