From 2af77abb1cc90562e3191ca6b384962934e2c626 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 5 Aug 2025 19:34:49 +0100 Subject: [PATCH] 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 --- test/units/TEST-50-DISSECT.dissect.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/units/TEST-50-DISSECT.dissect.sh b/test/units/TEST-50-DISSECT.dissect.sh index ff8a5dd4c7..a5dc65e469 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; \