From 5a3b8afd287fd35a83e4760db09d9929ce97c00d Mon Sep 17 00:00:00 2001 From: Karim Naufal Date: Thu, 3 Mar 2022 19:25:58 +0100 Subject: [PATCH] bounded the logs size and age --- modules/host/templates/userdata.yaml.tpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/host/templates/userdata.yaml.tpl b/modules/host/templates/userdata.yaml.tpl index b704130..6720ca5 100644 --- a/modules/host/templates/userdata.yaml.tpl +++ b/modules/host/templates/userdata.yaml.tpl @@ -43,6 +43,10 @@ runcmd: # We set Google DNS servers - [ sed, -i, 's#NETCONFIG_DNS_STATIC_SERVERS=""#NETCONFIG_DNS_STATIC_SERVERS="8.8.8.8 8.8.4.4"#g', /etc/sysconfig/network/config] +# Bound the amount of logs that can survive on the system +- [ sed, -i, 's/#SystemMaxUse=/SystemMaxUse=3G/g', /etc/systemd/journald.conf] +- [ sed, -i, 's/#MaxRetentionSec=/MaxRetentionSec=1week/g', /etc/systemd/journald.conf] + # Activate the private network - systemctl reload network