Adding Restart=always RestartSec=15 to /etc/systemd/system/mailman3.service ?
Hi - We had a power outage, and when the server restarted, mailman3 couldn't start, because mysql was doing a crash recovery and wasn't ready to accept connections. See syslog lines below.
I have Sympa mailing list running on another server, and it had a similar problem. But it eventually was able to start, because it kept trying. I believe this was because it has these 2 lines in it's service file:
Restart=always RestartSec=15
Would it cause any known problems to add this to mailman3.service? Thanks. - Mark
Jul 26 04:52:11 psfcmail2 mariadbd[938]: 2023-07-26 4:52:11 0 [Note] InnoDB: Completed initialization of buffer pool
Jul 26 04:52:12 psfcmail2 mariadbd[938]: 2023-07-26 4:52:12 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=9811536157,9811536157
Jul 26 04:52:13 psfcmail2 systemd[1]: Starting GNU Mailing List Manager...
...
Jul 26 04:52:25 psfcmail2 mailman[1313]: File "/opt/mailman/venv/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 901, in __connect
Jul 26 04:52:25 psfcmail2 mailman[1313]: self.dbapi_connection = connection = pool._invoke_creator(self)
Jul 26 04:52:25 psfcmail2 mailman[1313]: File "/opt/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/create.py", line 636, in connect
Jul 26 04:52:25 psfcmail2 mailman[1313]: return dialect.connect(*cargs, **cparams)
Jul 26 04:52:25 psfcmail2 mailman[1313]: File "/opt/mailman/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 580, in connect
Jul 26 04:52:25 psfcmail2 mailman[1313]: return self.loaded_dbapi.connect(*cargs, **cparams)
Jul 26 04:52:25 psfcmail2 mailman[1313]: File "/opt/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 352, in __init__
Jul 26 04:52:25 psfcmail2 mailman[1313]: self.connect()
Jul 26 04:52:25 psfcmail2 mailman[1313]: File "/opt/mailman/venv/lib/python3.10/site-packages/pymysql/connections.py", line 668, in connect
Jul 26 04:52:25 psfcmail2 mailman[1313]: raise exc
Jul 26 04:52:25 psfcmail2 mailman[1313]: sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on 'localhost' ([Errno 111] Connection refused)")
Jul 26 04:52:25 psfcmail2 systemd[1]: mailman3.service: Control process exited, code=exited, status=1/FAILURE
Jul 26 04:52:25 psfcmail2 systemd[1]: mailman3.service: Failed with result 'exit-code'.'.
Jul 26 04:52:25 psfcmail2 systemd[1]: Failed to start GNU Mailing List Manager.
Jul 26 04:52:25 psfcmail2 systemd[1]: Started GNU Mailman Web UI.
Jul 26 04:52:25 psfcmail2 uwsgi[1600]: [uWSGI] getting INI configuration from /etc/mailman3/uwsgi.ini
Jul 26 04:52:26 psfcmail2 mariadbd[938]: 2023-07-26 4:52:26 0 [Note] InnoDB: Read redo log up to LSN=9844697088
Jul 26 04:52:28 psfcmail2 mariadbd[938]: 2023-07-26 4:52:28 0 [Note] InnoDB: Starting final batch to recover 697 pages from redo log.
Edited by Mark Sapiro