Refactor dev MOTD/SSH setup and journal cleanup

Moved MOTD/SSH setup for dev mode in LXC containers to run after installation and when containers are kept for debugging, improving reliability and clarity. Updated journalctl cleanup to avoid using $STD and suppress errors if systemd-journald is not initialized. Also refactored indentation in misc/api.func for consistency.
This commit is contained in:
CanbiZ
2025-11-17 15:09:36 +01:00
parent 1090081a66
commit a7daaee5ae
3 changed files with 172 additions and 163 deletions

View File

@@ -834,8 +834,9 @@ cleanup_lxc() {
if command -v composer &>/dev/null; then $STD composer clear-cache || true; fi
if command -v journalctl &>/dev/null; then
$STD journalctl --rotate || true
$STD journalctl --vacuum-time=10m || true
# Journal rotation may fail if systemd-journald not fully initialized yet
journalctl --rotate 2>/dev/null || true
journalctl --vacuum-time=10m 2>/dev/null || true
fi
msg_ok "Cleaned"
}