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 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-12-05 17:40:29 -08:00
1 parent e045cbd39c
commit dee2ce19bb
1 file changed
+11 -4
+11 -4
View File
@@ -630,10 +630,17 @@ writing the v1.0 format until you finalize. Until then you can go back.
# 1. Every RUNNING volume process: /proc/<pid>/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 <instance> 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