From 5ba055937756b268da265280b8b69a621f679457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sj=C3=B6lund?= Date: Wed, 26 Jul 2023 17:52:29 +0200 Subject: [PATCH] [CI:DOCS] socket_activation.md: increase socat timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default socat timeout is 0.5 seconds. Make the socket-activate-echo example in socket_activation.md more robust by increasing the socat timeout. Fixes: https://github.com/containers/podman/issues/19373 Signed-off-by: Erik Sjölund --- docs/tutorials/socket_activation.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/socket_activation.md b/docs/tutorials/socket_activation.md index 1775354d5e..96bf64bacf 100644 --- a/docs/tutorials/socket_activation.md +++ b/docs/tutorials/socket_activation.md @@ -193,20 +193,23 @@ $ systemctl --user start echo.socket Test the echo server with the program __socat__ ``` -$ echo hello | socat - tcp4:127.0.0.1:3000 +$ echo hello | socat -t 30 - tcp4:127.0.0.1:3000 hello -$ echo hello | socat - tcp6:[::1]:3000 +$ echo hello | socat -t 30 - tcp6:[::1]:3000 hello -$ echo hello | socat - udp4:127.0.0.1:3000 +$ echo hello | socat -t 30 - udp4:127.0.0.1:3000 hello -$ echo hello | socat - udp6:[::1]:3000 +$ echo hello | socat -t 30 - udp6:[::1]:3000 hello -$ echo hello | socat - unix:$HOME/echo_stream_sock +$ echo hello | socat -t 30 - unix:$HOME/echo_stream_sock hello -$ echo hello | socat - VSOCK-CONNECT:1:3000 +$ echo hello | socat -t 30 - VSOCK-CONNECT:1:3000 hello ``` +The option `-t 30` configures socat to use a timeout of 30 seconds when socat reads from the socket awaiting to get an EOF (End-Of-File). +As the container image has already been pulled, such a long timeout is not really needed. + The echo server works as expected. It replies _"hello"_ after receiving the text _"hello"_. ### Example: socket activate an Apache HTTP server with systemd-socket-activate