[systemd-devel] Output from `tee' is not showing up in system journal consistently on some systems
Colin Guthrie
gmane at colin.guthr.ie
Wed Oct 27 08:52:15 UTC 2021
Mitchel Humpherys wrote on 26/10/2021 21:16:
> On my Manjaro and Ubuntu systems I'm not seeing all of the "pizza" lines
> (logs pasted here [3]). On Debian I see the "pizza" and "pie" lines
> interleaved as expected. It also works as expected when I run the script
> without systemd on Manjaro.
>
> Any ideas what's going on here? Why am I not seeing all of the output
> from `tee' on some systems?
>
> [2] https://github.com/mgalgs/systemd-tee-output-issue
Looking at the output there, the only thing I can see that's slightly
odd is that the "pie" output comes from the service's main pid (as
expected) but as tee is forked off the output there that *is* captured
is from a different pid each time.
So I wonder if this is some kind of cgroup race thing? i.e. the forked
off process is not (always) detected as being part of the unit in
question and thus isn't logged against the unit? If this is the case is
the a bash trick you can use to buffer the output back to the parent
process - e.g. just surrounding the command in parenthesis or something?
(I'm not a bash expert so no idea if this would work as a workaround!).
Appreciate any code change to work around this isn't ideal anyway, but
just trying to help debug the underlying problem.
This is just a random guess and might not at all be how the logging or
cgroup handing works!
Col
--
Colin Guthrie
More information about the systemd-devel
mailing list