Configure maximum size and timespan of journald logs #594

Merged
raucao merged 3 commits from feature/506-journald_logs_config into master 2025-05-21 12:12:58 +00:00
2 changed files with 7 additions and 8 deletions
Showing only changes of commit 7dc4f674a0 - Show all commits

View File

@ -0,0 +1,2 @@
node.default["kosmos-base"]["journald"]["system_max_use"] = "256M"
node.default["kosmos-base"]["journald"]["max_retention_sec"] = "7d"

View File

@ -3,15 +3,12 @@
# Recipe:: journald_conf
#
service "systemd-journald"
template "/etc/systemd/journald.conf" do
source "journald.conf.erb"
variables system_max_use: "256M",
max_retention_sec: "7d"
variables system_max_use: node["kosmos-base"]["journald"]["system_max_use"],
max_retention_sec: node["kosmos-base"]["journald"]["max_retention_sec"]
# Restarting journald is required
notifies :run, "execute[systemctl restart systemd-journald.service]", :delayed
end
execute "systemctl restart systemd-journald.service" do
command "systemctl restart systemd-journald.service"
action :nothing
notifies :restart, "service[systemd-journald]", :delayed
end