run: reject JSON output for trigger units

Reproducer:
  unit=run-json-trigger-$(date +%s)
  sudo systemd-run --json=short --unit="$unit" \
      --on-active=30s \
      /bin/true

Before, trigger mode accepted --json=short but printed only human-readable
"Running timer as unit" and "Will run service" lines. Reject the option
until trigger mode has structured output.

Follow-up for fe5a6c47af
This commit is contained in:
dongshengyuan
2026-07-14 12:03:22 +08:00
parent ecf38b0e22
commit 3fa641d01f
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -257,6 +257,7 @@ systemd-run --wait --machine=.host --pty true
systemd-run --json=short true | jq . >/dev/null
systemd-run --json=pretty true | jq . >/dev/null
(! systemd-run --wait --pipe --json=short true)
(! systemd-run --json=short --on-active=30s true)
(! SHELL=/bin/false systemd-run --quiet --shell)
(! systemd-run)