| index 2a69f3b..a944b35 100644 | ||
| --- a/src/plugin_services.c | ||
| +++ b/src/plugin_services.c | ||
| @@ -9,8 +9,8 @@ | ||
| 9 | 9 | * It reports every service the node's init system knows about: |
| 10 | 10 | * |
| 11 | 11 | * Linux systemd via `systemctl list-units --output=json` (falls back to the |
| 12 | - * plain table on systemd < 248), enriched once by a single | |
| 13 | - * `systemctl show --type=service --all -p ...` pass. Inside a | |
| 12 | + * plain table on systemd < 248), enriched by `systemctl show -p ...` | |
| 13 | + * over the validated unit names. Inside a | |
| 14 | 14 | * container with no init system (no /run/systemd/system) it reports |
| 15 | 15 | * init_system:"none" and lists the long-running daemons it can see in |
| 16 | 16 | * /proc instead of pretending the node has none. |
| @@ -565,7 +565,7 @@ static void parse_plain_units(const char *text) | ||
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | -/* One pass over `systemctl show --type=service --all -p ...`, whose output is | |
| 568 | +/* Output of `systemctl show -p ...` over a batch of unit names, whose output is | |
| 569 | 569 | * key=value blocks separated by a blank line. */ |
| 570 | 570 | static void apply_show(const char *text) |
| 571 | 571 | { |
| index d59ea44..7b1c3d2 100644 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -382,7 +382,7 @@ grep -q 'QueryServiceConfigA' src/plugin_services.c && pass "Windows reads the s | ||
| 382 | 382 | grep -q '_DARWIN_C_SOURCE' src/plugin_services.c && pass "_DARWIN_C_SOURCE is defined for Apple" || fail "_DARWIN_C_SOURCE missing" |
| 383 | 383 | grep -q 'launchctl list' src/plugin_services.c && pass "macOS reads launchctl list" || fail "no launchctl list" |
| 384 | 384 | grep -q 'output=json' src/plugin_services.c && pass "systemd uses --output=json first" || fail "no --output=json" |
| 385 | -grep -q 'systemctl show --type=service --all' src/plugin_services.c && fail "the empty-set 'show --type= --all' form is back" || pass "show asks for units by name, not the empty --type/--all set" | |
| 385 | +grep -q 'capture("systemctl show --type=service --all' src/plugin_services.c && fail "the empty-set 'show --type= --all' form is back" || pass "show asks for units by name, not the empty --type/--all set" | |
| 386 | 386 | grep -q 'systemctl show -p Id' src/plugin_services.c && pass "the enrichment pass asks for units by name" || fail "no per-unit show call" |
| 387 | 387 | grep -q 'not-found' src/plugin_services.c && pass "there is a legacy-table fallback path" || fail "no not-found handling" |
| 388 | 388 | grep -q 'init_system' src/plugin_services.c && pass "the API reports init_system" || fail "no init_system" |
| 389 | 389 |
| index 2a69f3b..a944b35 100644 | index 2a69f3b..a944b35 100644 | ||
| --- a/src/plugin_services.c | --- a/src/plugin_services.c | ||
| +++ b/src/plugin_services.c | +++ b/src/plugin_services.c | ||
| @@ -9,8 +9,8 @@ | @@ -9,8 +9,8 @@ | ||
| 9 | * It reports every service the node's init system knows about: | 9 | * It reports every service the node's init system knows about: |
| 10 | * | 10 | * |
| 11 | * Linux systemd via `systemctl list-units --output=json` (falls back to the | 11 | * Linux systemd via `systemctl list-units --output=json` (falls back to the |
| 12 | - * plain table on systemd < 248), enriched once by a single | 12 | + * plain table on systemd < 248), enriched by `systemctl show -p ...` |
| 13 | - * `systemctl show --type=service --all -p ...` pass. Inside a | 13 | + * over the validated unit names. Inside a |
| 14 | * container with no init system (no /run/systemd/system) it reports | 14 | * container with no init system (no /run/systemd/system) it reports |
| 15 | * init_system:"none" and lists the long-running daemons it can see in | 15 | * init_system:"none" and lists the long-running daemons it can see in |
| 16 | * /proc instead of pretending the node has none. | 16 | * /proc instead of pretending the node has none. |
| @@ -565,7 +565,7 @@ static void parse_plain_units(const char *text) | @@ -565,7 +565,7 @@ static void parse_plain_units(const char *text) | ||
| 565 | } | 565 | } |
| 566 | } | 566 | } |
| 567 | 567 | ||
| 568 | -/* One pass over `systemctl show --type=service --all -p ...`, whose output is | 568 | +/* Output of `systemctl show -p ...` over a batch of unit names, whose output is |
| 569 | * key=value blocks separated by a blank line. */ | 569 | * key=value blocks separated by a blank line. */ |
| 570 | static void apply_show(const char *text) | 570 | static void apply_show(const char *text) |
| 571 | { | 571 | { |
| index d59ea44..7b1c3d2 100644 | index d59ea44..7b1c3d2 100644 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -382,7 +382,7 @@ grep -q 'QueryServiceConfigA' src/plugin_services.c && pass "Windows reads the s | @@ -382,7 +382,7 @@ grep -q 'QueryServiceConfigA' src/plugin_services.c && pass "Windows reads the s | ||
| 382 | grep -q '_DARWIN_C_SOURCE' src/plugin_services.c && pass "_DARWIN_C_SOURCE is defined for Apple" || fail "_DARWIN_C_SOURCE missing" | 382 | grep -q '_DARWIN_C_SOURCE' src/plugin_services.c && pass "_DARWIN_C_SOURCE is defined for Apple" || fail "_DARWIN_C_SOURCE missing" |
| 383 | grep -q 'launchctl list' src/plugin_services.c && pass "macOS reads launchctl list" || fail "no launchctl list" | 383 | grep -q 'launchctl list' src/plugin_services.c && pass "macOS reads launchctl list" || fail "no launchctl list" |
| 384 | grep -q 'output=json' src/plugin_services.c && pass "systemd uses --output=json first" || fail "no --output=json" | 384 | grep -q 'output=json' src/plugin_services.c && pass "systemd uses --output=json first" || fail "no --output=json" |
| 385 | -grep -q 'systemctl show --type=service --all' src/plugin_services.c && fail "the empty-set 'show --type= --all' form is back" || pass "show asks for units by name, not the empty --type/--all set" | 385 | +grep -q 'capture("systemctl show --type=service --all' src/plugin_services.c && fail "the empty-set 'show --type= --all' form is back" || pass "show asks for units by name, not the empty --type/--all set" |
| 386 | grep -q 'systemctl show -p Id' src/plugin_services.c && pass "the enrichment pass asks for units by name" || fail "no per-unit show call" | 386 | grep -q 'systemctl show -p Id' src/plugin_services.c && pass "the enrichment pass asks for units by name" || fail "no per-unit show call" |
| 387 | grep -q 'not-found' src/plugin_services.c && pass "there is a legacy-table fallback path" || fail "no not-found handling" | 387 | grep -q 'not-found' src/plugin_services.c && pass "there is a legacy-table fallback path" || fail "no not-found handling" |
| 388 | grep -q 'init_system' src/plugin_services.c && pass "the API reports init_system" || fail "no init_system" | 388 | grep -q 'init_system' src/plugin_services.c && pass "the API reports init_system" || fail "no init_system" |
| 389 | 389 |