0

when running systemd-run --pty --same-dir --wait --service-type=exec I get all the command output in journal. While nice, it is not something I want/can afford all the time.

for example, if I want root to run ls as

systemd-run --user  --nice=+1 --same-dir --collect --service-type=exec --pty --wait --unit MYSYSRUND ls -la

how can I avoid the output of ls being on journal? metadata is fine.

1
  • 1
    Does this actually happen even with --pty being specified? Commented May 27, 2024 at 4:27

1 Answer 1

1

@u1686_grawity was correct on the suspicion posted on the question comment.

With --pty the outputs are not sent to the logs. I made a mistake in my tests and and assumed it logged output either way. My question above is wrong.

The solution then is to add --pty and deal with the output (e.g. >/dev/null) and all work as expected.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.