On Wed, 29 Jul 2020 at 02:58, Mark Sapiro <mark@msapiro.net> wrote:
On 7/28/20 2:34 AM, Odhiambo Washington wrote:
So, now I remember why I had to chown -R mailman3 /opt/mailman Then now it seems like I have been doing things incorrectly, because I
have
been doing a lot of operations as root by simply: cd /opt/mailman/mm virtualenv venv source venv/bin/activate Looks like the correct way is to start with su - mailman3
Yes. All those things should be done as the Mailman user.
PS: There is the issue with qcluster, which doesn't seem to have been ... I have run it from supervisord. It has forked 30 processes and refuses to kill them when I stop supervisord. I will look for options around it.
I know nothing about supervisord, but there should be a parent process. E.g., here
msapiro@mail:~$ ps -fwwu mailman|grep qcluster mailman 2885 1 0 Jul18 ? 00:00:00 /bin/bash /opt/mailman/mm/bin/mailman-web-django-admin qcluster mailman 2889 2885 0 Jul18 ? 00:01:57 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 2930 2889 0 Jul18 ? 01:21:03 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 2944 2930 0 Jul18 ? 00:04:17 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 2945 2930 3 Jul18 ? 07:11:14 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 6467 2930 0 15:39 ? 00:00:03 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 12337 2930 0 15:00 ? 00:00:07 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 12639 2930 0 11:08 ? 00:00:11 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 14658 2930 0 Jul27 ? 00:00:22 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 15860 2930 0 01:41 ? 00:00:21 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster mailman 19205 2930 0 Jul27 ? 00:00:29 /opt/mailman/mm/venv/bin/python /opt/mailman/mm/venv/bin/django-admin qcluster msapiro@mail:~$
pid 2885 is the parent which forked 2889 which in turn forked 2930 which forked all the others. stopping (sigterm) 2885 in this case will stop them all.
I have seen an issue on one server where some of the qcluster workers become orphaned and their parent pid is 1. These are left when I stop the upstart service so I have this script.
#! /bin/bash if echo
status qcluster
| grep -q 'running' ; then echo qcluster is running exit fi ps -fwwu mailman|grep '[a]dmin qcluster'|awk '{print $2}'|xargs killto kill them.
I found some obscure option for supervisord that enabled the killing of the process(es). Obscure because it's not documented in the sample configuration for supervisord, but it's out there in the wild.
PS: Did you by any chance find time to look into the issue about wsgi.py that you had mentioned - the one that has me stuck using it??
If you're referring to the issue at the end of < https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
, I think that was caused by your not having the __init__.py file in /opt/mailman/mm/.
If not, I probably need more information.
Yes, the same problem. I created the file __init__.py in /opt/mailman/mm However, when I run using the wsgi.py I ended up (still do!) with the error:
[Wed Jul 29 10:08:51.869144 2020] [wsgi:info] [pid 79132] [remote 197.232.81.246:64709] mod_wsgi (pid=79132, process='mailman-web', application='mm3-lists.server.name|/mm3'): Loading Python script file '/opt/mailman/mm/wsgi.py'. [Wed Jul 29 10:08:51.872461 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] mod_wsgi (pid=79132): Failed to exec Python script file '/opt/mailman/mm/wsgi.py'. [Wed Jul 29 10:08:51.872507 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] mod_wsgi (pid=79132): Exception occurred processing WSGI script '/opt/mailman/mm/wsgi.py'. [Wed Jul 29 10:08:51.872754 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] Traceback (most recent call last): [Wed Jul 29 10:08:51.872827 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/opt/mailman/mm/wsgi.py", line 38, in <module> [Wed Jul 29 10:08:51.872835 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] application = get_wsgi_application() [Wed Jul 29 10:08:51.872847 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/opt/mailman/mm/venv/lib/python3.7/site-packages/Django-3.0.8-py3.7.egg/django/core/wsgi.py", line 12, in get_wsgi_application [Wed Jul 29 10:08:51.872852 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] django.setup(set_prefix=False) [Wed Jul 29 10:08:51.872862 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/opt/mailman/mm/venv/lib/python3.7/site-packages/Django-3.0.8-py3.7.egg/django/__init__.py", line 19, in setup [Wed Jul 29 10:08:51.872868 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) [Wed Jul 29 10:08:51.872878 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/opt/mailman/mm/venv/lib/python3.7/site-packages/Django-3.0.8-py3.7.egg/django/conf/__init__.py", line 76, in __getattr__ [Wed Jul 29 10:08:51.872884 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] self._setup(name) [Wed Jul 29 10:08:51.872893 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/opt/mailman/mm/venv/lib/python3.7/site-packages/Django-3.0.8-py3.7.egg/django/conf/__init__.py", line 63, in _setup [Wed Jul 29 10:08:51.872899 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] self._wrapped = Settings(settings_module) [Wed Jul 29 10:08:51.872909 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/opt/mailman/mm/venv/lib/python3.7/site-packages/Django-3.0.8-py3.7.egg/django/conf/__init__.py", line 142, in __init__ [Wed Jul 29 10:08:51.872914 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] mod = importlib.import_module(self.SETTINGS_MODULE) [Wed Jul 29 10:08:51.872923 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module [Wed Jul 29 10:08:51.872929 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] return _bootstrap._gcd_import(name[level:], package, level) [Wed Jul 29 10:08:51.872938 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "<frozen importlib._bootstrap>", line 994, in _gcd_import [Wed Jul 29 10:08:51.872949 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "<frozen importlib._bootstrap>", line 971, in _find_and_load [Wed Jul 29 10:08:51.872960 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked [Wed Jul 29 10:08:51.872984 2020] [wsgi:error] [pid 79132] [remote 197.232.81.246:64709] ModuleNotFoundError: No module named 'settings'
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", grep ^[^#] :-)