From 23685502f3f923930cc9c24a1e2e99b5173d2a37 Mon Sep 17 00:00:00 2001
From: David Luevano Alvarado It’s been a while since I’ve been running a minimal server on a VPS, and it is a pretty humble VPS with just 32 GB of storage which works for me as I’m only hosting a handful of services. At some point I started noticing that the disk keept filling up on each time I checked. Turns out that out of the box, Arch has a default config for For systemd
‘s journald
that keeps a persistent journal
log, but doesn’t have a limit on how much logging is kept. This means that depending on how many services, and how aggresive they log, it can be filled up pretty quickly. For me I had around 15 GB of logs, from the normal journal
directory, nginx
directory and my now unused prosody
instance.prosody
it was just a matter of deleting the directory as I’m not using it anymore, which freed around 4 GB of disk space.
-For journal
I did a combination of configuring SystemMaxUse
and creating a Namespace for all “email” related services as mentioned in the Arch wiki: systemd/Journal; basically just configuring /etc/systemd/journald.conf
(and /etc/systemd/journald@email.con
with the comment change) with:[Journal]
+For
journal
I did a combination of configuring SystemMaxUse
and creating a Namespace for all “email” related services as mentioned in the Arch wiki: systemd/Journal; basically just configuring /etc/systemd/journald.conf
(and /etc/systemd/journald@email.conf
with the comment change) with:
[Journal]
Storage=persistent
SystemMaxUse=100MB # 50MB for the "email" Namespace
And then for each service that I want to use this “email” Namespace I add:
-[Service]
+[Service]
LogNamespace=email
Which can be changed manually or by executing systemctl edit service_name.service
and it will create an override file which will be read on top of the normal service configuration. Once configured restart by running systemctl daemon-reload
and systemctl restart service_name.service
(probably also restart systemd-journald
).
@@ -142,6 +142,7 @@ LogNamespace=email
By David Luévano
Created: Thu, Jun 15, 2023 @ 10:22 UTC
+ Modified: Thu, Jun 15, 2023 @ 10:24 UTC