[Mailman-Users] Strange errors

Mark Sapiro msapiro at value.net
Fri Oct 21 21:47:36 CEST 2005


Dan Szkola wrote:

>OK, I found something extremely odd. For some reason,
>the Utils.pyc in /usr/local/mailman/Mailman/Logging
>direcotry is being removed and then the compile of it
>seems to fail and I'm left with a 0 byte file. It is
>owned by the daemon user and later it gets compiled
>and is owned by the mailman user.
>
># ls -l
>total 60
>-rw-r--r--   1 root     mailman     3380 May 31 08:39 Logger.py
>-rw-r--r--   1 www      mailman     3175 May 31 08:43 Logger.pyc
>-rw-r--r--   1 root     mailman     2559 May 31 08:39 MultiLogger.py
>-rw-r--r--   1 root     mailman     2133 May 31 08:43 MultiLogger.pyc
>-rw-r--r--   1 root     mailman     3204 May 31 08:39 StampedLogger.py
>-rw-r--r--   1 www      mailman     2933 May 31 08:43 StampedLogger.pyc
>-rw-r--r--   1 root     mailman     2221 May 31 08:39 Syslog.py
>-rw-r--r--   1 www      mailman     1709 May 31 08:43 Syslog.pyc
>-rw-r--r--   1 root     mailman     1912 May 31 08:39 Utils.py
>-rw-r--r--   1 daemon   mailman        0 Oct 21 09:27 Utils.pyc
>-rw-r--r--   1 root     mailman      785 May 31 08:39 __init__.py
>-rw-r--r--   1 www      mailman      126 May 31 08:43 __init__.pyc
>
># ls -l
>total 64
>-rw-r--r--   1 root     mailman     3380 May 31 08:39 Logger.py
>-rw-r--r--   1 www      mailman     3175 May 31 08:43 Logger.pyc
>-rw-r--r--   1 root     mailman     2559 May 31 08:39 MultiLogger.py
>-rw-r--r--   1 root     mailman     2133 May 31 08:43 MultiLogger.pyc
>-rw-r--r--   1 root     mailman     3204 May 31 08:39 StampedLogger.py
>-rw-r--r--   1 www      mailman     2933 May 31 08:43 StampedLogger.pyc
>-rw-r--r--   1 root     mailman     2221 May 31 08:39 Syslog.py
>-rw-r--r--   1 www      mailman     1709 May 31 08:43 Syslog.pyc
>-rw-r--r--   1 root     mailman     1912 May 31 08:39 Utils.py
>-rw-r--r--   1 mailman  mailman     1308 Oct 21 09:30 Utils.pyc
>-rw-r--r--   1 root     mailman      785 May 31 08:39 __init__.py
>-rw-r--r--   1 www      mailman      126 May 31 08:43 __init__.pyc

Presumably daemon is the user that sendmail uses to invoke the wrapper.
When you tried invoking the wrapper manually and did not get the
error, were you running it as the daemon user? If not, you might try
that.

The recompiling is strange in itself. Normally, if the .pyc is more
recent than the .py, accessible and not corrupt, it is just used, so
once you have a good one, why is python trying to recompile it? And if
Python is recompiling this module when invoked in the 'odd' way, is it
also doing others, and why does this cause a problem (if it is a
cause)?

Do any other Mailman .pyc files have way more recent dates than the
corresponding .py, or are any others owned by 'daemon'?

Maybe next time try something like

find /usr/local/mailman -type f -a \( -mtime 0 -o -user daemon \)

Also, try running the

/usr/local/mailman/mail/mailman admin listname <file

as user daemon and the appropriate group if you haven't already.

I really don't understand what's happening since sendmail should always
be invoking the wrapper with the same user:group and that works at
first.

In order to even more closely mimic sendmail, you could try

cat file | /usr/local/mailman/mail/mailman admin listname

instead of the above. Beyond that, the only difference I can see is the
environment, but we say previously, after the wrapper got done with
the environment, all that was there was

PYTHONPATH /usr/local/mailman
AGENT sendmail

and PYTHONPATH is always put there by the wrapper and presumably AGENT
is always put there by sendmail.

So, why does it only seem to fail when sendmail invokes it and only
after some successful invocations, and why does restarting sendmail
fix it while restarting Mailman (which will recompile
/usr/local/mailman/Mailman/Logging/Utils.py) doesn't fix it?

Maybe we need to take this to comp.lang.python.

-- 
Mark Sapiro <msapiro at value.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