From fc9f93336e57e9254d8dcc60f821caaacabebbae Mon Sep 17 00:00:00 2001 From: Mikkeli Date: Wed, 14 Oct 2026 08:32:17 +0900 Subject: [PATCH] Power plan: battery-low shutdown built; logrotate's jetson-logging fixed Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz --- docs/impl/plans/POWER.md | 9 +++++++-- docs/impl/reports/LOGROTATE.md | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/impl/reports/LOGROTATE.md diff --git a/docs/impl/plans/POWER.md b/docs/impl/plans/POWER.md index 94cbb7f..1480032 100644 --- a/docs/impl/plans/POWER.md +++ b/docs/impl/plans/POWER.md @@ -1,7 +1,7 @@ --- type: plan status: active -updated: 2026-10-09 +updated: 2026-10-14 --- # Car Power: Ride Through Cranking, Shut Down at Ignition Off @@ -32,11 +32,16 @@ A small host service polling the INA219 about every 1 s: | on input | current ≥ about 0 | nothing | | on battery | discharging, < grace | publish `system/power` "on battery"; **a short episode that recovers is a crank**: stamp it into the recording | | ignition off | discharging continuously for grace (start at 60 s; tune after the car crank test) | publish "shutting down" → stop capture (close the session cleanly) → optional parked-at-home step → `systemctl poweroff` | -| battery low | voltage below a floor (around 10.5 V for 3S, to confirm), at any time | `systemctl poweroff` immediately | +| battery low | **built 2026-10-14** (svc-core `orin-status --poweroff-below 11.0 --poweroff-after 30`): below 11.0 V *while discharging*, 30 readings (1/s) in a row; a missing reading restarts the count | state `stopping` on `yukart/system/orin-status`, then `systemctl poweroff` through svc-gw's polkit grant (no sudo) | Optional parked-at-home step: if home WiFi/LAN is reachable at ignition off, stay up long enough to copy recordings off over the LAN (same LAN-only rule as map sync, project-yukart decision 10), within a hard time cap, then shut down. +The battery-low row came first: on 2026-10-14 the pack ran flat overnight with the Orin up and nothing to stop it, +and the boot's journal ends mid-stream at 06:29:22 (ext4 replayed its journal on the next boot; nothing lost). +11.0 V while discharging at the Orin's ~0.45 A is about 10 % charge, a margin for a clean shutdown; 30 s rides out a +crank or a load spike. The ignition-off rows are still to build. + ## Open: getting the Orin back on at ignition on After `poweroff` the UPS keeps supplying the board from its battery: diff --git a/docs/impl/reports/LOGROTATE.md b/docs/impl/reports/LOGROTATE.md new file mode 100644 index 0000000..cdb5aed --- /dev/null +++ b/docs/impl/reports/LOGROTATE.md @@ -0,0 +1,25 @@ +--- +type: report +date: 2026-10-14 +--- +# logrotate failed every day: NVIDIA's jetson-logging + +`logrotate.service` failed on every run (`error: stat of /data/logging-volume/*.log failed: Permission +denied`), leaving a permanent entry in `systemctl --failed`. + +**Cause.** `/etc/logrotate.d/jetson-logging` (package `nvidia-jetson-services`) has two stanzas for +`/data/logging-volume/*.log`. The first rotates as user `logging` (`su logging logusers`), but `/data` is +`drwx------ root`, so that user cannot reach the directory. The second is the package's copy for setups where +that user does not exist: same files, rotated as root. With both present, logrotate also reports a duplicate +entry. The directory is empty: nothing on this host writes there. + +**Fix (2026-10-14).** The first stanza is removed; the root stanza and the Docker one stay. A comment at the top +of the file says so. Original kept at `~/infra/logrotate/jetson-logging.orig`. + +```bash +sudo logrotate -d /etc/logrotate.conf # dry run: no error for jetson-logging +sudo systemctl start logrotate.service # "Finished Rotate log files." +``` + +The file is a dpkg conffile: an upgrade of `nvidia-jetson-services` that changes it asks whether to keep the +local version. Keep it (or re-apply: drop the `su logging logusers` stanza).