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
fe5a6c47af675bc0020c545d86fb103492e1d77c
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"--timer-property= has no effect without any other timer options.");
+ if (sd_json_format_enabled(arg_json_format_flags) && with_trigger)
+ return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
+ "--json= is not compatible with path, socket or timer operations.");
+
if (arg_wait) {
if (arg_no_block)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
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)