From dee2ce19bbe406f97edf7e8f369c0748272c7363 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 5 Dec 2026 17:40:29 -0800 Subject: [PATCH] seaweed-block: docs: the unit check includes unloaded instances overridden by their own drop-ins Review: list-unit-files finds unit files and templates, and list-units finds instances in memory, so an unloaded instance whose ExecStart is set only by its own drop-in directory was missed. The inventory now also takes the enabled instance links and the instance drop-in directories; systemctl cat on an instance shows the template with its drop-ins. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operations-manual.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index 842c171035..61ce613e82 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -630,10 +630,17 @@ writing the v1.0 format until you finalize. Until then you can go back. # 1. Every RUNNING volume process: /proc//exe runs the image that process is running, # even if an upgrade has since replaced the file on disk. for pid in $(pgrep -x blockvolume); do printf '%s ' "$pid"; sudo /proc/"$pid"/exe --version; done - # 2. The binary each unit would start on a restart: every blockvolume unit, loaded or not (an enabled but - # stopped unit is not loaded, so a systemctl glob alone would skip it). - units=$(systemctl list-unit-files 'sw-blockvolume*' --no-legend | cut -d' ' -f1 - systemctl list-units --all 'sw-blockvolume@*' --no-legend --plain | cut -d' ' -f1) + # 2. The binary each unit would start on a restart: every blockvolume unit and instance, loaded or not (an + # enabled but stopped unit is not loaded, so a systemctl glob alone would skip it). Instances come from the + # loaded list, the enabled links, and instance drop-in directories (an instance-only override, such as + # sw-blockvolume@v1.service.d/override.conf, can set its own ExecStart); systemctl cat shows the + # template with that instance's drop-ins. + units=$( { systemctl list-unit-files 'sw-blockvolume*' --no-legend | cut -d' ' -f1 + systemctl list-units --all 'sw-blockvolume@*' --no-legend --plain | cut -d' ' -f1 + ls /etc/systemd/system/*.wants/ /run/systemd/system/*.wants/ 2>/dev/null | grep '^sw-blockvolume' + for d in /etc/systemd/system/sw-blockvolume*.service.d /run/systemd/system/sw-blockvolume*.service.d; do + [ -d "$d" ] && basename "$d" .d + done; } | sort -u) for b in $(for u in $units; do systemctl cat "$u"; done | sed -n 's/^ExecStart=\([^ ]*\).*/\1/p' | sort -u); do printf '%s ' "$b"; "$b" --version done