Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Tools/PC/persist_journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def info(s: str):
journal_config["Journal"]["Storage"] = "persistent"
# journal_config["Journal"]["MaxFileSec"] = "180day"
journal_config["Journal"]["SystemMaxFiles"] = "200"
journal_config["Journal"]["SystemMaxUse"] = "10G"
journal_config["Journal"]["SystemMaxUse"] = "50G"

ok = (
input(
Expand All @@ -51,6 +51,7 @@ def info(s: str):
with open("/etc/systemd/journald.conf", "w") as f:
journal_config.write(f)

sp.run(["sudo", "systemctl", "daemon-reload"])
sp.run(["sudo", "systemctl", "restart", "systemd-journald"])
Comment on lines +54 to 55
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script already exits unless it’s run as root (os.getuid() == 0), so invoking systemctl via sudo here is redundant and can break in environments without sudo or where sudo requires a TTY. Consider calling systemctl directly and using check=True so failures don’t get silently ignored.

Also, daemon-reload is intended for unit file changes; it doesn’t apply to journald.conf and can be removed unless there’s a specific unit/drop-in change this script makes.

Copilot uses AI. Check for mistakes.
info("Journal service has been restarted with the new config!")
info("The backup config is at /etc/systemd/journald.conf.bak")