[ZODB-Dev] zeo, data.fs permissions

Guido van Rossum guido@python.org
Sat, 31 Aug 2002 09:17:01 -0400


> Hi, I'm trying to install ZEO2 (the latest version 2.0b1).  Here's a rough
> outline of what I've done.  I have Red Hat 7.3:

You're not saying as which user you're doing.  I assume you're doing
it all as root?

> 1.  Build Python 2.1.3 RPMs from the SRPM.
> 2.  Install Python 2.1.3 RPM and devel RPMs generated in step 1.
> 3.  Build Zope 2.5.1 RPMs from the SRPM.
> 4.  Install Zope 2.5.1 and zserver RPMs generated in step 3.
> 5.  Unpack ZEO 2.0b1 tarball in /var/tmp -- generating /var/tmp/ZEO
> 6.  In a bash shell:
> 
>   # so python2.1 can find zope libs.
>   export PYTHONPATH='/usr/share/zope/lib/python'
> 
>   cd /usr/share/zope
>   sudo python2.1 lib/python/ZEO/start.py -p 9000 -u zope

But then why the sudo?

> Output:
> 
> Traceback (most recent call last):
>   File "lib/python/ZEO/start.py", line 248, in main
>     storages['1'] = FileStorage(fs or env.fs)
>   File "/home/mark/rpm/BUILD/Zope-2.5.1-src/lib/python/ZODB/FileStorage.py",
> line 240, in __init__
> IOError: [Errno 13] Permission denied: '/usr/share/zope/var/Data.fs'
> 
> which is not surprising given that /usr/share/zope/var/Data.fs has mode 600
> (rw- --- ---).  If I do this:

Without giving owner info as well that doesn't help much.

>   # This is a drastic measure to see if I can trample roughshod
>   # over the permission error.
>   chown -R zope:zope /usr/share/zope/var
>   chmod -R +rw /usr/share/zope/var
> 
> It starts after I do that, but I doubt my drastic approach is a good one.

Sounds good to me; or you could've done the Zope part of the install
as user 'zope'.

> Also, shouldn't I have to put the custom_zodb.py in the Zope folder BEFORE
> starting ZEO?  (The docs/ZopeREADME.txt talks about running start.py BEFORE
> custom_zodb.py.)

No, it's only read by the client.  start.py runs the server.

> I'm just trying to get ZEO and Zope running on the same
> server.  This is what my custom_zodb.py looks like:
> 
>   # custom_zodb.py in Zope install directory (/usr/share/zope)
>   from ZEO.ClientStorage import ClientStorage
>   port = 9000
>   Storage = ClientStorage(('localhost', port))
> 
> After I put the custom_zodb.py in the Zope folder, start ZEO, and then start
> Zope, I can access Zope, but I'm not sure how to tell that it's actually
> using ZEO.

Turning on logging (STUPID_LOG_FILE etc.) should give you more clues.

Also, you could try to stop the ZEO server and see if that affects the
Zope instance.  If it doesn't, there's a good chance that you are
indeed not using ZEO. :-)

> In the ZMI/Control Panel/Database Management tab, I don't see
> anything about Client Storage, for instance.  Here's what it says:
> 
> <zmi>
> The Database Manager allows you to view database status information. It also
> allows you to perform maintenance tasks such as database packing and cache
> management.
> 
> Database Location  /var/zope/var/Data.fs
> Database Size  2.0M
> 
> 
> Click pack to pack the Zope database, removing previous revisions of objects
> that are older than  days.
> </zmi>
> 
> Also, why is there a Data.fs in /var/zope/var AND in /usr/share/zope/var?
> (Revealing my ignorance again.)

Dunno (revealing mine) -- check their atimes to see which one is
actually used?

> Well, I appreciate any insights anyone can share with me.

Check the atime of the custom_zodb.py file to see if it is being
read.  Make sure it is readable for user 'zope'.

--Guido van Rossum (home page: http://www.python.org/~guido/)