[Pkg-mailman-hackers] Bug#881329: systemd service

Stefan Bühler stbuehler at lighttpd.net
Fri Nov 10 11:19:53 UTC 2017


Package: mailman
Version: 1:2.1.23-1+deb9u1

Hi,

it would be nice if the mailman package offered a real systemd service;
that way it could be automatically restarted on crashes (e.g.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505638), and
`systemctl list-units --failed` would complain properly when it isn't
working.

For this I suggest these two files:

/usr/lib/tmpfiles.d/mailman.conf
---
# path              mode uid  gid
d /run/mailman      0755 list list
d /run/lock/mailman 2775 root list
---

(dh_installinit should create these automatically in .postinst when
systemd is active)

/lib/systemd/system/mailman.service
---
[Unit]
Description=Mailman Master Queue Runner
After=network.target

[Service]
Type=forking
PIDFile=/var/run/mailman/mailman.pid
ExecStart=/usr/lib/mailman/bin/mailmanctl -s start
ExecStop=/usr/lib/mailman/bin/mailmanctl stop
ExecReload=/usr/lib/mailman/bin/mailmanctl restart
Restart=always
RestartSec=3s

[Install]
WantedBy=multi-user.target
Alias=mailman-qrunner.service
---

mailmanctl checks for the existence of the site list on start itself, I
don't see any need to keep/clone this logic.

In [Unit] one could add:
---
ConditionFileIsExecutable=/usr/bin/python
---
to replicate the check from the init script.

cheers,
Stefan



More information about the Pkg-mailman-hackers mailing list