
Hi Mark,
I did just a quick search and read about issues related to Click and init scripts. See below.
On Tue, Sep 5, 2017, at 09:19 AM, Mark Sapiro wrote:
I'm beginning to develop some understanding of this. I think it is not related to the changes for plugins, but rather is related to the use of click and possibly something to do with run levels.
I have put logging in /opt/mailman/mailman-bundler/venv-3.4/bin/mailman to report the command that invoked it before it in turn invokes mailman.bin.mailman.main(), and I put logging there to report the fact that control got there.
The log looks like
Tue Sep 5 15:42:57 2017 ['/opt/mailman/mailman-bundler/venv-3.4/bin/mailman', '-C', '/opt/mailman/mailman-bundler/deployment/mailman.cfg', 'stop'] Tue Sep 5 15:42:58 2017 mailman.py - main() Tue Sep 5 15:43:08 2017 ['/opt/mailman/mailman-bundler/venv-3.4/bin/mailman', '-C', '/opt/mailman/mailman-bundler/deployment/mailman.cfg', 'start', '--force'] Tue Sep 5 15:43:09 2017 mailman.py - main() Tue Sep 5 15:47:16 2017 ['/opt/mailman/mailman-bundler/venv-3.4/bin/mailman', '-C', '/opt/mailman/mailman-bundler/deployment/mailman.cfg', 'stop'] Tue Sep 5 15:48:13 2017 ['/opt/mailman/mailman-bundler/venv-3.4/bin/mailman', '-C', '/opt/mailman/mailman-bundler/deployment/mailman.cfg', 'start', '--force'] Tue Sep 5 15:58:39 2017 ['/opt/mailman/mailman-bundler/venv-3.4/bin/mailman', '-C', '/opt/mailman/mailman-bundler/deployment/mailman.cfg', 'start', '--force'] Tue Sep 5 15:58:47 2017 mailman.py - main()
The 15:42:.. entries are from a manual stop. The 15:43:.. entries are from a manual start. The 15:47:16 entry is the 'stop' from a reboot - note no 'mailman.py - main()' here, and the 15:48:13 entry is the 'start' from the reboot - again no 'mailman.py - main()' here. Finally, the 15:58:.., entries are from a manual start.
There are several 'click' decorators on the mailman.bin.mailman.main() function, and I suspect something there is detecting the run level and just quitting if a shutdown or startup is in progress.
I would like to try systemd instead, but both lists.mailman3.org and mail.python.org are on Ubuntu 14.04 which doesn't support systemd.
I *looks* like your observation about the click *might* be correct, I'd have to test more to find out which can't for next few days. Here is an excerpt from the click documentation1:
Click in Python 3 does all the Unicode handling in the standard library and is subject to its behavior. In Python 2, Click does all the Unicode handling itself, which means there are differences in error behavior.
The most glaring difference is that in Python 2, Unicode will “just work”, while in Python 3, it requires extra care. The reason for this is that in Python 3, the encoding detection is done in the interpreter, and on Linux and certain other operating systems, its encoding handling is problematic.
The biggest source of frustration is that Click scripts invoked by init systems (sysvinit, upstart, systemd, etc.), deployment tools (salt, puppet), or cron jobs (cron) will refuse to work unless a Unicode locale is exported.
If Click encounters such an environment it will prevent further execution to force you to set a locale. This is done because Click cannot know about the state of the system once it’s invoked and restore the values before Python’s Unicode handling kicked in.
It does mention that an error trace will show up when there are locale problems with Python 3, but I guess you don't see any of that. Maybe it is suppressed somewhere?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Developers mailing list Mailman-Developers@python.org https://mail.python.org/mailman/listinfo/mailman-developers Mailman FAQ: http://wiki.list.org/x/AgA3 Searchable Archives: http://www.mail-archive.com/mailman-developers%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-developers/raj.abhilash1%40g...
Security Policy: http://wiki.list.org/x/QIA9 Email had 1 attachment:
- signature.asc 1k (application/pgp-signature)