[Mailman-Users] Hangs when trying to start mailman as root

Mark Sapiro mark at msapiro.net
Tue Sep 25 21:46:23 CEST 2012


Lummoxx wrote:
>
>That hangs just like trying to start mailman.  Whatever it's doing, it's a
>nasty little hang.  A ctrl-c in the window won't even kill it.  Here in
>python or the mailmanctl file.
>
>Here's a thought.  The server is also using libnss-pgsql.  The mailman user
>and group exist normally in /etc/passwd and /etc/group, but it still may be
>getting confused by this functionality?


I don't know if this is the issue or not. It certainly seems possible.
I've looked at the code for the Python grp module. It is a C language
module and uses the C library functions setgrent, getgrent and
endgrent to get the group information. My guess is there is some
incompatibility with the C library used to build your Python and your
system configuration.


>Is it possible that this section can be modified to specifically set
>whatever that line is trying to do?  We know that the mailman user and
>group on this machine is mailman.


The code that contains the failing line is attempting to determine all
the supplemental groups of which the 'mailman' user is a member and
set those groups as the suplemental groups for the process. This could
be necessary if you had local mods to Mailman which required the
Mailman processes to be a member of one or more of those groups (other
than 'mailman') to access something, but in a standard Mailman, this
shouldn't be necessary.

Thus, if you modify mailmanctl as follows, I think you'll be OK.

In the section

    if myuid == 0:
        # Set the process's supplimental groups.
        groups = [x[2] for x in grp.getgrall() if mm_cfg.MAILMAN_USER
in x[3]]
        groups.append(gid)
        try:
            os.setgroups(groups)
        except AttributeError:
            # Python 2.1 doesn't have setgroups
            syslog('error', 'Warning: unable to setgroups(%s)' % groups)
        os.setgid(gid)
        os.setuid(uid)

remove or comment all but the first and last 2 lines to make it
effectively

    if myuid == 0:
        os.setgid(gid)
        os.setuid(uid)

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list