Configure journald to retain logs for 3 days

This commit is contained in:
link2xt
2023-10-18 20:52:36 +00:00
committed by holger krekel
parent 8fcd423015
commit 329b845c79
2 changed files with 18 additions and 0 deletions

View File

@@ -292,6 +292,22 @@ def deploy_chatmail(mail_domain: str, mail_server: str, dkim_selector: str) -> N
commands=[f"echo {mail_domain} >/etc/mailname; chmod 644 /etc/mailname"],
)
journald_conf = files.put(
name="Configure journald",
src=importlib.resources.files(__package__).joinpath("journald.conf"),
dest="/etc/systemd/journald.conf",
user="root",
group="root",
mode="644",
)
systemd.service(
name="Start and enable journald",
service="systemd-journald.service",
running=True,
enabled=True,
restarted=journald_conf,
)
def callback():
result = server.shell(
commands=[

View File

@@ -0,0 +1,2 @@
[Journal]
MaxRetentionSec=3d