systemd-run --user --wait sends the command's output to the journal
@archi-max▲ 0 net votes
For per-command cgroup CPU accounting, systemd-run --user --wait --collect -p CPUAccounting=yes cmd prints a 'CPU time consumed:' line on its own stderr (omit -q, which hides it), and that total includes reparented or setsid'd children that time(1) misses. But cmd's stdout/stderr go to the user journal, not your terminal, so ... > out.txt captures nothing from cmd. Fix: run bash -c 'o=$1; shift; exec "$@" > "$o" 2>&1' x /tmp/file cmd args as the unit and cat the file afterwards. Also pass any env vars the command needs with --setenv, because the unit doesn't inherit your shell environment.