From: jcmalek@lakeheadu.ca
To: poky@lists.yoctoproject.org
Subject: stdout overwriting logger output for service units
Date: Wed, 23 Nov 2022 09:08:40 -0800 [thread overview]
Message-ID: <oy3w.1669223320962012665.WVBs@lists.yoctoproject.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2554 bytes --]
Hi there Poky team,
I have recently noticed that some of the stdout output has been overwriting the logger output when I do a "journalctl -u service_name" on any of the services. The systemd team has referred me to this project (my downstream distro) to look into the issue before they are willing to have a look. They would ideally like this tested on a newer version of systemd. The steps to reproduce the problem are fairly simple. I have hopefully included all the relevant details below. Please let me know if there is anything else you need.
systemd version the issue has been seen with
--------------------------------------------
246
Used distribution
-----------------
Poky (Yocto Project Reference Distro) 3.2.4 \n \l
Linux kernel version used
-------------------------
5.12.10
CPU architectures issue was seen on
-----------------------------------
arm
Component
---------
journalctl
Expected behaviour you didn't see
---------------------------------
Expected both logger and standard output to appear in service unit logs:
journalctl -f -u test
Nov 16 15:05:08 c-00012 sh[1617]: Standard output: 1
Nov 16 15:05:08 c-00012 root[1650]: Logger: 1
Nov 16 15:05:08 c-00012 sh[1617]: Standard output: 2
Nov 16 15:05:08 c-00012 root[1652]: Logger: 2
Nov 16 15:05:09 c-00012 sh[1617]: Standard output: 3
Nov 16 15:05:09 c-00012 root[1654]: Logger: 3
Nov 16 15:05:10 c-00012 sh[1617]: Standard output: 4
Nov 16 15:05:10 c-00012 root[1656]: Logger: 4
Nov 16 15:05:11 c-00012 sh[1617]: Standard output: 5
Nov 16 15:05:11 c-00012 root[1658]: Logger: 5
Unexpected behaviour you saw
----------------------------
I only get the standard output messages and every once and a while one of the logger messages sneaks through:
journalctl -f -u test
Nov 16 15:05:08 c-00012 sh[1617]: Standard output: 1
Nov 16 15:05:08 c-00012 sh[1617]: Standard output: 2
Nov 16 15:05:09 c-00012 sh[1617]: Standard output: 3
Nov 16 15:06:09 c-00012 root[1654]: Logger: 3
Nov 16 15:05:10 c-00012 sh[1617]: Standard output: 4
Nov 16 15:05:11 c-00012 sh[1617]: Standard output: 5
Steps to reproduce the problem
------------------------------
test.service contents:
[Unit]
Description=Test
DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=/bin/sh /mytest.sh
RemainAfterExit=yes
/mytest.sh contents:
#!/bin/sh
i=0
while [ $i -le 100 ]; do
echo "Standard output: ${i}"
logger "Logger: ${i}"
sleep 1
i=$((i+1))
done
* journalctl -f -u test
* systemctl start test
[-- Attachment #2: Type: text/html, Size: 10413 bytes --]
next reply other threads:[~2022-11-23 17:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-23 17:08 jcmalek [this message]
2022-11-30 2:01 ` [poky] stdout overwriting logger output for service units Khem Raj
2022-12-06 20:38 ` jcmalek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=oy3w.1669223320962012665.WVBs@lists.yoctoproject.org \
--to=jcmalek@lakeheadu.ca \
--cc=poky@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).