mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 21:08:03 +00:00
@@ -11,6 +11,9 @@
|
|||||||
- journald: remove old logs from disk
|
- journald: remove old logs from disk
|
||||||
([#490](https://github.com/deltachat/chatmail/pull/490))
|
([#490](https://github.com/deltachat/chatmail/pull/490))
|
||||||
|
|
||||||
|
- opendkim: restart once every day to mend RAM leaks
|
||||||
|
([#498](https://github.com/chatmail/chatmail/pull/498)
|
||||||
|
|
||||||
- migration guide: let opendkim own the DKIM keys directory
|
- migration guide: let opendkim own the DKIM keys directory
|
||||||
([#468](https://github.com/deltachat/chatmail/pull/468))
|
([#468](https://github.com/deltachat/chatmail/pull/468))
|
||||||
|
|
||||||
|
|||||||
@@ -221,6 +221,14 @@ def _configure_opendkim(domain: str, dkim_selector: str = "dkim") -> bool:
|
|||||||
_su_user="opendkim",
|
_su_user="opendkim",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
service_file = files.put(
|
||||||
|
name="Configure opendkim to restart once a day",
|
||||||
|
src=importlib.resources.files(__package__).joinpath("opendkim/systemd.conf"),
|
||||||
|
dest="/etc/systemd/system/opendkim.service.d/10-prevent-memory-leak.conf",
|
||||||
|
)
|
||||||
|
need_restart |= service_file.changed
|
||||||
|
|
||||||
|
|
||||||
return need_restart
|
return need_restart
|
||||||
|
|
||||||
|
|
||||||
@@ -653,6 +661,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
|
|||||||
service="opendkim.service",
|
service="opendkim.service",
|
||||||
running=True,
|
running=True,
|
||||||
enabled=True,
|
enabled=True,
|
||||||
|
daemon_reload=opendkim_need_restart,
|
||||||
restarted=opendkim_need_restart,
|
restarted=opendkim_need_restart,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
3
cmdeploy/src/cmdeploy/opendkim/systemd.conf
Normal file
3
cmdeploy/src/cmdeploy/opendkim/systemd.conf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[Service]
|
||||||
|
Restart=always
|
||||||
|
RuntimeMaxSec=1d
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import datetime
|
||||||
import smtplib
|
import smtplib
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@@ -52,6 +53,14 @@ class TestSSHExecutor:
|
|||||||
else:
|
else:
|
||||||
pytest.fail("didn't raise exception")
|
pytest.fail("didn't raise exception")
|
||||||
|
|
||||||
|
def test_opendkim_restarted(self, sshexec):
|
||||||
|
"""check that opendkim is not running for longer than a day."""
|
||||||
|
out = sshexec(call=remote.rshell.shell, kwargs=dict(command="systemctl status opendkim"))
|
||||||
|
assert type(out) == str
|
||||||
|
since_date_str = out.split("since ")[1].split(";")[0]
|
||||||
|
since_date = datetime.datetime.strptime(since_date_str, "%a %Y-%m-%d %H:%M:%S %Z")
|
||||||
|
assert (datetime.datetime.now() - since_date).total_seconds() < 60 * 60 * 24
|
||||||
|
|
||||||
|
|
||||||
def test_remote(remote, imap_or_smtp):
|
def test_remote(remote, imap_or_smtp):
|
||||||
lineproducer = remote.iter_output(imap_or_smtp.logcmd)
|
lineproducer = remote.iter_output(imap_or_smtp.logcmd)
|
||||||
|
|||||||
Reference in New Issue
Block a user