[Mailman-Developers] Mailman 3 not restarting after reboot [addendum]

Mark Sapiro mark at msapiro.net
Mon Sep 4 23:59:20 EDT 2017


On 09/02/2017 06:27 PM, Mark Sapiro wrote:
> On 09/02/2017 12:30 PM, Barry Warsaw wrote:
>> It would be interesting to know if the problem is in the init script or Mailman.  You may have to crank up logging of both to find out.  Also, I wonder if the same problem occurs if you use systemd?
> 
> 
> It appears to be in Mailman.


This get's stranger and stranger.

I removed the logging from the init.d script which invokes
/opt/mailman/mailman-bundler/bin/mailman with the appropriate start/stop
option. I then added logging to it. Here it is:

#!/bin/bash
unset PYTHONSTARTUP

echo `date` At bundler/bin/mailman >> /opt/mailman/temp_log

exec /opt/mailman/mailman-bundler/venv-3.4/bin/mailman \
    -C "/opt/mailman/mailman-bundler/deployment/mailman.cfg" \
    $@

so when invoked it prints a timestamp and 'At bundler/bin/mailman'.

I also added logging to
/opt/mailman/mailman-bundler/venv-3.4/bin/mailman as follows:

#!/usr/local/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'mailman==3.2.0a1','console_scripts','mailman'
__requires__ = 'mailman==3.2.0a1'
import re
import sys
import time
from pkg_resources import load_entry_point

if __name__ == '__main__':
    with open('/opt/mailman/temp_log', 'a') as fp:
        print('{} At venv bin/mailman __main__'.format(time.asctime()),
file=fp)
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(
        load_entry_point('mailman==3.2.0a1', 'console_scripts', 'mailman')()
    )

so it prints a time stamp and 'At venv bin/mailman __main__' in the if
__name__ == '__main__': block.

Finally, I added a bit to the main() function in mailman/bin/mailman.py
so it reads (a bunch of decorators omitted):

def main(ctx, config_file):
    # XXX https://github.com/pallets/click/issues/303
    """\
    The GNU Mailman mailing list management system
    Copyright 1998-2017 by the Free Software Foundation, Inc.
    http://www.list.org
    """
    # click handles dispatching to the subcommand via the Subcommands class.
    import time
    with open('/opt/mailman/temp_log', 'a') as fp:
        print('{} At mailman.main'.format(time.asctime()), file=fp)


Then I rebooted and subsequently manually ran sudo service mailman
start. I got this in temp_log

Tue Sep 5 03:10:57 UTC 2017 At bundler/bin/mailman
Tue Sep  5 03:10:58 2017 At venv bin/mailman __main__
Tue Sep 5 03:11:57 UTC 2017 At bundler/bin/mailman
Tue Sep  5 03:11:58 2017 At venv bin/mailman __main__
Tue Sep 5 03:15:17 UTC 2017 At bundler/bin/mailman
Tue Sep  5 03:15:18 2017 At venv bin/mailman __main__
Tue Sep  5 03:15:22 2017 At mailman.main

The 03:10:.. entries are from the 'stop' from the reboot. The absence of
'At mailman.main' may be significant. All the normal shutdown messages
are in mailman.log about 6-7 seconds later. But, if I do 'sudo service
mailman stop' there is an 'At mailman.main' message logged.

Then the 3:11:.. entries are from init running the init.d/mailman script
and indicate that /opt/mailman/mailman-bundler/bin/mailman and
/opt/mailman/mailman-bundler/venv-3.4/bin/mailman were both invoked, but
there is nothing in mailman.log and no 'At mailman.main' message. Then
the  03:15:.. entries are from when I manually started Mailman.

It appears that

load_entry_point('mailman==3.2.0a1', 'console_scripts', 'mailman')()

is being executed by /opt/mailman/mailman-bundler/venv-3.4/bin/mailman,
but either somehow the 'start' argument is lost or something after that
fails. I don't know how the 'start' argument could be getting lost, but
I don't know what else could be failing either.

Any hints?

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/mailman-developers/attachments/20170904/793ccfd2/attachment.sig>


More information about the Mailman-Developers mailing list