Merge branch 'frajo/log-prev' into 'main'

Move the old logfile before creating a new one.

See merge request deckard/lepton!205
This commit is contained in:
Franz-Josef Haider committed 2026-10-05 22:02:37 +00:00
commit 8be10c8a86
1 file changed
+3 -1
+3 -1
View File
@@ -108,7 +108,9 @@ function log_to_file()
{
local LEPTON_LOG_FILE="$(lepton_log_file)"
exec 1> >(uninherit_lepton_lock; grep --line-buffered -v "skipping destruction (fork without exec?)" | grep --line-buffered -v "from LD_PRELOAD cannot be preloaded" | tee -a "${LEPTON_LOG_FILE}" || true) 2>&1
mv "${LEPTON_LOG_FILE}" "${LEPTON_LOG_FILE%.log}.prev.log" 2>/dev/null || true
exec 1> >(uninherit_lepton_lock; grep --line-buffered -v "skipping destruction (fork without exec?)" | grep --line-buffered -v "from LD_PRELOAD cannot be preloaded" | tee "${LEPTON_LOG_FILE}" || true) 2>&1
# When we start logging to file, we want to make it easy to differentiate different runs, so let's print empty lines, the date, and the PID:
printf "\n\nLepton %s (rootfs %s) starting up at %s\n" "$(lepton_version)" "$(lepton_rootfs_version)" "$(date)"