diff --git a/bundles/raspberrypi/metadata.py b/bundles/raspberrypi/metadata.py index b03c085..169836c 100644 --- a/bundles/raspberrypi/metadata.py +++ b/bundles/raspberrypi/metadata.py @@ -20,4 +20,11 @@ defaults = { 'net.ifnames=0', }, }, + 'systemd': { + 'journal': { + 'storage': 'volatile', + 'maxuse': '100M', + 'keepfree': '100M', + }, + }, } diff --git a/bundles/systemd/files/journald.conf b/bundles/systemd/files/journald.conf new file mode 100644 index 0000000..4d91060 --- /dev/null +++ b/bundles/systemd/files/journald.conf @@ -0,0 +1,16 @@ +[Journal] +Storage=${journal.get('storage', 'persistent')} +Compress=yes +SplitMode=uid + +# Disable rate limiting. +RateLimitIntervalSec=0 +RateLimitBurst=0 + +SystemMaxUse=${journal.get('maxuse', '500M')} +SystemKeepFree=${journal.get('keepfree', '2G')} +SystemMaxFileSize=100M +MaxFileSec=0 + +# Disable auditing +Audit=no diff --git a/bundles/systemd/items.py b/bundles/systemd/items.py index ac4493e..b8f6436 100644 --- a/bundles/systemd/items.py +++ b/bundles/systemd/items.py @@ -24,3 +24,23 @@ actions = { 'unless': 'timedatectl status | grep -Fi \'ntp service\' | grep -i \'active\'', }, } + +files = { + '/etc/systemd/journald.conf': { + 'content_type': 'mako', + 'context': { + 'journal': node.metadata.get('systemd', {}).get('journal', {}), + }, + 'triggers': { + 'svc_systemd:systemd-journald:restart', + }, + }, +} + +svc_systemd = { + 'systemd-journald': { + 'needs': { + 'file:/etc/systemd/journald.conf', + }, + }, +}