From: Luca Boccassi Date: Tue, 5 Aug 2025 18:34:49 +0000 (+0100) Subject: test: ensure printf builtin buffers and does a single write when piping into socat X-Git-Tag: v258-rc3~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2af77abb1cc90562e3191ca6b384962934e2c626;p=thirdparty%2Fsystemd.git test: ensure printf builtin buffers and does a single write when piping into socat Should hopefully solve this: [ 111.084463] systemd[1]: testservice-50k.service: Got notification message from PID 2651: RELOADING=1 [ 111.085980] systemd[1]: testservice-50k.service: Got notification message from PID 2651: MONOTONIC_USEC=111072508 ie, pid1 receives RELOADING=1 and MONOTONIC_USEC= in different messages instead of a single one, and reload-notify breaks Follow-up for 3998b30a040d1494918e11c78ef3eae72532bbca Fixes https://github.com/systemd/systemd/issues/37626 --- diff --git a/test/units/TEST-50-DISSECT.dissect.sh b/test/units/TEST-50-DISSECT.dissect.sh index ff8a5dd4c74..a5dc65e4694 100755 --- a/test/units/TEST-50-DISSECT.dissect.sh +++ b/test/units/TEST-50-DISSECT.dissect.sh @@ -653,7 +653,7 @@ NotifyAccess=all ExecStart=bash -x -c ' \ trap '"'"' \ now=\$\$(grep "^now" /proc/timer_list | cut -d" " -f3 | rev | cut -c 4- | rev); \ - printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + stdbuf -o1K printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ (ls /etc | grep marker) >/tmp/markers/50i; \ (cat /usr/lib/os-release) >>/tmp/markers/50i; \ echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ @@ -688,7 +688,7 @@ NotifyAccess=all ExecStart=bash -x -c ' \ trap '"'"' \ now=\$\$(grep "^now" /proc/timer_list | cut -d" " -f3 | rev | cut -c 4- | rev); \ - printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + stdbuf -o1K printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ (ls /etc | grep marker) >/tmp/markers/50j; \ (cat /usr/lib/os-release) >>/tmp/markers/50j; \ echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ @@ -718,7 +718,7 @@ NotifyAccess=all ExecStart=bash -x -c ' \ trap '"'"' \ now=\$\$(grep "^now" /proc/timer_list | cut -d" " -f3 | rev | cut -c 4- | rev); \ - printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ + stdbuf -o1K printf "RELOADING=1\\nMONOTONIC_USEC=\$\${now}\\n" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \ (ls /etc | grep marker) >/tmp/markers/50k; \ (cat /usr/lib/os-release) >>/tmp/markers/50k; \ echo "READY=1" | socat -t 5 - UNIX-SENDTO:\$\$NOTIFY_SOCKET; \