src.nth.io/

summaryrefslogtreecommitdiff
path: root/rpi-base
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-03-23 22:22:36 -0500
committerLuke Hoersten <[email protected]>2026-03-23 22:22:36 -0500
commit1859f62813f0c586ea49f912944fb25efd60520f (patch)
tree5e92465f6e24cda9f4c38c2c2c00d0c0ccd7c525 /rpi-base
parentb7fbbf6810d4d53ca7a0afca31134181f7025a67 (diff)
Fixed log rotation and log2ram sizing.
Diffstat (limited to 'rpi-base')
-rw-r--r--rpi-base/files/journald.conf2
-rw-r--r--rpi-base/files/logrotate.conf11
-rw-r--r--rpi-base/handlers/main.yaml4
-rw-r--r--rpi-base/tasks/main.yaml9
4 files changed, 26 insertions, 0 deletions
diff --git a/rpi-base/files/journald.conf b/rpi-base/files/journald.conf
new file mode 100644
index 0000000..523f571
--- /dev/null
+++ b/rpi-base/files/journald.conf
@@ -0,0 +1,2 @@
+[Journal]
+SystemMaxUse=100M
diff --git a/rpi-base/files/logrotate.conf b/rpi-base/files/logrotate.conf
new file mode 100644
index 0000000..e6690c0
--- /dev/null
+++ b/rpi-base/files/logrotate.conf
@@ -0,0 +1,11 @@
+# Sized to fit within log2ram's RAM disk.
+# Defaults: daily, 7 rotations, compress immediately, max 50M per log.
+# Worst case per log: 50M active + 7 x compressed ~ 100M
+
+daily
+su root adm
+rotate 7
+maxsize 50M
+create
+compress
+include /etc/logrotate.d
diff --git a/rpi-base/handlers/main.yaml b/rpi-base/handlers/main.yaml
index 7d9c45e..5335035 100644
--- a/rpi-base/handlers/main.yaml
+++ b/rpi-base/handlers/main.yaml
@@ -3,3 +3,7 @@
- name: restart log2ram service
systemd: name="log2ram" state="restarted" daemon_reload="yes"
become: yes
+
+- name: restart journald
+ systemd: name="systemd-journald" state="restarted"
+ become: yes
diff --git a/rpi-base/tasks/main.yaml b/rpi-base/tasks/main.yaml
index 390134a..c9626b6 100644
--- a/rpi-base/tasks/main.yaml
+++ b/rpi-base/tasks/main.yaml
@@ -40,6 +40,15 @@
become: yes
copy: src="20auto-upgrades" dest="/etc/apt/apt.conf.d/20auto-upgrades"
+- name: configure logrotate
+ become: yes
+ copy: src="logrotate.conf" dest="/etc/logrotate.conf"
+
+- name: configure journald max size
+ become: yes
+ copy: src="journald.conf" dest="/etc/systemd/journald.conf"
+ notify: restart journald
+
- name: configure log2ram disk size
become: yes
lineinfile: