On 10/19/22 21:23, Stephen J. Turnbull wrote:
Onyeibo Oku writes:
Mailman starts well from virtual environment though, ... but systemd doesn't replicate that success.
systemd doesn't know anything about venv. If it's possible to source (not call as a command!) the venv bin/activate script via systemd, that should fix it. If not, we'll have to figure out what it is that the venv provides that the current systemd config does not. I would guess that after sourcing the venv's bin/activate
Our suggested systemd script at https://docs.mailman3.org/en/latest/install/virtualenv.html#starting-mailman... has
ExecStart=/opt/mailman/venv/bin/mailman start ExecReload=/opt/mailman/venv/bin/mailman restart ExecStop=/opt/mailman/venv/bin/mailman stop
/opt/mailman/venv/bin/mailman should work whether or not a venv is active.
Judging from the traceback, Onyeibo Oku's /opt/mailman/venv/bin/mailman is quite different from mine which is just
#!/opt/mailman/venv/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'mailman==3.3.5','console_scripts','mailman'
__requires__ = 'mailman==3.3.5'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('mailman==3.3.5', 'console_scripts', 'mailman')()
)
What is yours? and can you start mailman as the mailman user with
/opt/mailman/venv/bin/mailman start
without activating the venv?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan