diff --git a/src/run/run.c b/src/run/run.c index 6754b80bcf3..e49e918b0fc 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -735,6 +735,10 @@ static int parse_argv(int argc, char *argv[]) { 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), diff --git a/test/units/TEST-74-AUX-UTILS.run.sh b/test/units/TEST-74-AUX-UTILS.run.sh index a5c79ddb72e..0619a8995f7 100755 --- a/test/units/TEST-74-AUX-UTILS.run.sh +++ b/test/units/TEST-74-AUX-UTILS.run.sh @@ -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)