<div dir="ltr">Hello,<br><br>I'm having an issue with logging from some of my user services on some systems but not others. I asked this on ServerFault a few days ago [1] but haven't gotten any responses. I apologize if this sort of question is not allowed here.<br><br>On some systems, output from `tee' is not making it into the system journal consistently. I've reproduced the issue on Manjaro (systemd 249) and Ubuntu (systemd 245), but I can't reproduce it on Debian 11 (systemd 247). I don't see any glaring differences between my systemd configurations on Manjaro and Debian (diff -r /etc/systemd ~/tmp/debian_systemd).<br><br>I have full repro instructions over here [2], but I'm pasting the script and service file here to save you a click:<br><br>tee_test.sh<br><br>#!/bin/bash<br><br>LOGFILE=/tmp/testtee.log<br>echo > "$LOGFILE"<br>echo "i like pie" | tee -a "$LOGFILE"<br><br>i=2<br>while :; do<br>    echo "i shall eat $i slices of pizza" | tee -a "$LOGFILE"<br>    echo "i shall eat $i slices of pie"<br>    ((i++))<br>    sleep 1<br>done<br><br>~/.config/systemd/user/tee_test.service<br><br>[Unit]<br>Description=Test teeing under systemd<br><br>[Service]<br># same result with either of the following two variants<br>ExecStart=/usr/local/bin/tee_test.sh<br># ExecStart=stdbuf -i0 -o0 -e0 /usr/local/bin/tee_test.sh<br><br># same result with or without this guy<br>StandardOutput=journal+console<br><br>[Install]<br>WantedBy=default.target<br><br><br>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.<br><br>Any ideas what's going on here? Why am I not seeing all of the output from `tee' on some systems?<br><br>Full version info of the systems I've tested:<br><br>Manjaro<br>systemd 249 (249.4-2-manjaro)<br>+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified<br><br>Ubuntu 20.04<br>systemd 245 (245.4-4ubuntu3.5)<br>+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid<br><br><br>Debian 11 (WORKS!)<br>systemd 247 (247.3-6)<br>+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified<br><br>Thanks!<br>Mitch<br><br>[1] <a href="https://serverfault.com/q/1081172/66928">https://serverfault.com/q/1081172/66928</a><br><div>[2] <a href="https://github.com/mgalgs/systemd-tee-output-issue">https://github.com/mgalgs/systemd-tee-output-issue</a></div><div>[3] <a href="https://github.com/mgalgs/systemd-tee-output-issue#logs-in-system-journal">https://github.com/mgalgs/systemd-tee-output-issue#logs-in-system-journal</a></div></div>