Subject: Python 2.3.3 and Zope 2.7
To: None <netbsd-users@netbsd.org>
From: Bob Bernstein <rs@bernstein.providence.ri.us>
List: netbsd-users
Date: 04/27/2004 01:55:23
I have python23-pth-2.3.3nb3 installed on a somewhat dated i386
current install (NetBSD 1.6ZI (GENERIC) #0: Wed Jan 28). I use it
to build, without apparent incident, the Zope-2.7.0.tgz source
tarball.

If this is done under an ordinary user's $HOME account, the
resultant zope 2.7 launches without incident, but if zope is built
under, say, /usr/local/, and asked to effectively assume the
identity of a non-root user, zope will not launch. 

The new etc/zope.conf file in the zope instance makes it easy to
specify this "suid" user:

# Directive: effective-user
#
# Description:
#     If you intend to run Zope as the "root" user, you must supply this
#     directive with an effective username or userid number to which Zope
#     will 'suid' after the server ports are bound. This directive only
#     has effect under UNIX and if Zope is started as the root user.
#
# Default: unset
#
# Example:
#
effective-user myzope

To get to the point, here's the error when zope is launched under
these conditions:

trollboy /usr/local/zope27 # bin/runzope &
[1] 1904
trollboy /usr/local/zope27 # ------
2004-04-27T01:49:15 INFO(0) ZServer HTTP server started at Tue Apr 27 01:49:15 2004
        Hostname: trollboy.host_obfuscated.org
        Port: 8088
Traceback (most recent call last):
  File "/usr/local/lib/Zope2.7/lib/python/Zope/Startup/run.py", line 49, in ?
    run()
  File "/usr/local/lib/Zope2.7/lib/python/Zope/Startup/run.py", line 19, in run
    start_zope(opts.configroot)
  File "/usr/local/lib/Zope2.7/lib/python/Zope/Startup/__init__.py", line 48, in start_zope
    starter.dropPrivileges()
  File "/usr/local/lib/Zope2.7/lib/python/Zope/Startup/__init__.py", line 203, in dropPrivileges
    return dropPrivileges(self.cfg)
  File "/usr/local/lib/Zope2.7/lib/python/Zope/Startup/__init__.py", line 347, in dropPrivileges
    initgroups.initgroups(effective_user, gid)
AttributeError: 'module' object has no attribute 'initgroups'

Interestingly enough, if I repeat the above experiment on an
OpenBSD 3.5 installation, using their Python 2.3.3 port, and the
same Zope 2.7 tarball, the launch succeeds. 

Does this point to a problem with NetBSD's Python 2.3.3?


-- 
Bob Bernstein

   "A modern philosopher who has never once suspected himself of
    being a charlatan must be such a shallow mind that his work is
    probably not worth reading."        Leszek Kolakowski