From 1e7d5715de453c838829b8e97a345b9396a051df Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:10 +0100 Subject: fix(just): unit-status handles template instances and static units - use systemctl is-enabled per curated unit (list-unit-files does not show instantiated template units like btrfs-scrub@-.timer) - accept static/indirect/generated/alias states in addition to enabled - drop pkgstats.timer from curated (no [Install] section) - ignore systemd-oomd.socket (distro default) --- justfile | 12 +++++++++++- systemd-units/.ignore | 1 + systemd-units/base.txt | 1 - 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index ef7f8f4..aee1d50 100644 --- a/justfile +++ b/justfile @@ -451,9 +451,19 @@ unit-status: else : > "$tmp/ignore" fi + # Curated units missing from the system: use is-enabled to correctly + # handle instantiated template units (which list-unit-files does not show). + while read -r u; do + [ -z "$u" ] && continue + state=$(systemctl is-enabled "$u" 2>/dev/null || true) + case "$state" in + enabled|enabled-runtime|alias|static|indirect|generated) ;; + *) echo " not-enabled: $u" ;; + esac + done < "$tmp/curated" + # Enabled unit files not in curated (minus ignore list). systemctl list-unit-files --state=enabled --no-legend 2>/dev/null \ | awk '{print $1}' | grep -vE '@\.' | sort -u > "$tmp/enabled" - comm -23 "$tmp/curated" "$tmp/enabled" | sed 's/^/ not-enabled: /' comm -13 "$tmp/curated" "$tmp/enabled" | comm -23 - "$tmp/ignore" | sed 's/^/ uncurated: /' # Append one or more units to a group list and enable them (e.g. just unit-add base sshd.service) diff --git a/systemd-units/.ignore b/systemd-units/.ignore index cb1b0ce..32f2225 100644 --- a/systemd-units/.ignore +++ b/systemd-units/.ignore @@ -8,6 +8,7 @@ systemd-networkd.socket systemd-networkd-resolve-hook.socket systemd-networkd-varlink.socket systemd-networkd-varlink-metrics.socket +systemd-oomd.socket systemd-resolved-monitor.socket systemd-resolved-varlink.socket systemd-userdbd.socket diff --git a/systemd-units/base.txt b/systemd-units/base.txt index 85bb09c..6f8582a 100644 --- a/systemd-units/base.txt +++ b/systemd-units/base.txt @@ -6,7 +6,6 @@ systemd-resolved.service systemd-oomd.service reflector.timer paccache.timer -pkgstats.timer acpid.service cpupower.service iwd.service -- cgit v1.3.1