[ZCM] [ZC] 2249/ 2 Edit "ZEO default install doesn't work with the 'user zope' directive in zeo.conf"

"Collector: Zope Bugs, Features, and Patches ..." <[email protected]>
Newsgroups gmane.comp.web.zope.devel.collector-monitor
Message-ID <[email protected]>
Issue #2249 Update (Edit) "ZEO default install doesn't work with the 'user zope' directive in zeo.conf"
 Status Pending, Zope/bug+solution low
To followup, visit:
  http://www.zope.org/Collectors/Zope/2249

==============================================================
= Edit - Entry #2 by ajung on Dec 1, 2006 8:08 am

 Changes: submitter email, importance (medium => low), new comment

There is usually no need to install Zope/ZEO as root.
It is "best practice" to install Zope/ZEO as unprivileged user.
________________________________________
= Request - Entry #1 by esrever_otua on Dec 1, 2006 7:55 am

Create a default install of Zope.
Run bin/mkzeoinstance.py to create a ZEO instance (as root).
Chown -R all files in the ZEO instance directory to be owned by 'zope'.
edit $INSTANCE/etc/zeo.conf and uncomment the '# user zope' directive.
Attempt to start zeo as the root user. Parent process will spin and child processes will die silently.

The problem is that the logfile ($INSTANCE/log/zeo.log) is created on the first run by the parent process, and is therefore owned by root. The child processes attempt to open the file for writing and get unhandled exception IOErrror Permission Denied (see traceback below).

Therefore, the parent process needs to create the logfile as the 'zope' user (or whatever is defined in zeo.conf).

TRACEBACK:
[zope@directender zeo]$ bin/zeoctl start
. Traceback (most recent call last):
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdrun.py", line 719, in ?
    main()
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdrun.py", line 716, in main
    d.main(args)
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdrun.py", line 240, in main
    self.options.realize(args)
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdrun.py", line 108, in realize
    RunnerOptions.realize(self, *args, **kwds)
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdoptions.py", line 363, in realize
    ZDOptions.realize(self, *args, **kwds)
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdoptions.py", line 303, in realize
    self.load_logconf(self.logsectionname)
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdrun.py", line 127, in load_logconf
    RunnerOptions.load_logconf(self, "eventlog")
  File "/zope/apps/zope-2.9.6/lib/python/zdaemon/zdoptions.py", line 337, in load_logconf
    obj.startup()
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/logger.py", line 51, in startup
    self()
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/factory.py", line 32, in __call__
    self.instance = self.create()
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/logger.py", line 42, in create
    handler = handler_factory()
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/factory.py", line 32, in __call__
    self.instance = self.create()
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/handlers.py", line 69, in create
    logger = self.create_loghandler()
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/handlers.py", line 87, in create_loghandler
    handler = loghandler.FileHandler(path)
  File "/zope/apps/zope-2.9.6/lib/python/ZConfig/components/logger/loghandler.py", line 34, in __init__
    StreamHandler.__init__(self, open(filename, mode))
IOError: [Errno 13] Permission denied: '/zope/prd/zeo/log/zeo.log'
==============================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.