diff options
| author | 2026-05-13 13:43:10 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:10 +0100 | |
| commit | 1e7d5715de453c838829b8e97a345b9396a051df (patch) | |
| tree | 83397873207ec41360d0303eebc9268eaeabd7d6 /justfile | |
| parent | 6188cc46324fac775edc0e155a014b5fb55312fb (diff) | |
| download | dotfiles-1e7d5715de453c838829b8e97a345b9396a051df.tar.gz dotfiles-1e7d5715de453c838829b8e97a345b9396a051df.tar.bz2 dotfiles-1e7d5715de453c838829b8e97a345b9396a051df.zip | |
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)
Diffstat (limited to 'justfile')
| -rw-r--r-- | justfile | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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) |
