From: "mattock (Code Review)" Date: Tue, 10 Jun 2025 11:27:03 +0000 In-Reply-To: References: Reply-To: sasepp@...2783..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296... Message-ID: <9c64d5016cbbfdb93f30c54769d61057c8730241-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="YfWb7gFQYvg="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: t_server_null: print error when server startup fails List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --YfWb7gFQYvg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, plaisthos. Hello flichtenheld, plaisthos, I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=3Demail to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by flichtenheld Change subject: t_server_null: print error when server startup fails ...................................................................... t_server_null: print error when server startup fails The --daemon option has to be at the end of the command-line. Moreover, if a pid-file is not found or is empty, launch a new server instance without --log or --daemon so that the error message is printed properly. Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Signed-off-by: Samuli Sepp=C3=A4nen --- M tests/t_server_null_default.rc M tests/t_server_null_server.sh 2 files changed, 13 insertions(+), 15 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/1024/2 diff --git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc index 5b74761..1f2fa2c 100755 --- a/tests/t_server_null_default.rc +++ b/tests/t_server_null_default.rc @@ -38,7 +38,7 @@ MAX_CLIENTS=3D"10" CLIENT_MATCH=3D"Test-Client" SERVER_EXEC=3D"${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS=3D"--daemon --dev tun --topology subnet --max-clients $MA= X_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS=3D"--dev tun --topology subnet --max-clients $MAX_CLIENTS= --persist-tun --verb 3 --duplicate-cn" SERVER_BIND_OPTS=3D"--local 127.0.0.1" SERVER_CIPHER_OPTS=3D"" SERVER_CERT_OPTS=3D"--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SE= RVER_KEY} --tls-auth ${TA} 0" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..716a9e5 100755 --- a/tests/t_server_null_server.sh +++ b/tests/t_server_null_server.sh @@ -11,20 +11,18 @@ # Allow reading this file even umask values are strict touch "$log" - if [ -z "${RUN_SUDO}" ]; then - "${server_exec}" \ - $server_conf \ - --status "${status}" 1 \ - --log "${log}" \ - --writepid "${pid}" \ - --explicit-exit-notify 3 - else - $RUN_SUDO "${server_exec}" \ - $server_conf \ - --status "${status}" 1 \ - --log "${log}" \ - --writepid "${pid}" \ - --explicit-exit-notify 3 + # Try to launch the server + $RUN_SUDO "${server_exec}" \ + $server_conf \ + --status "${status}" 1 \ + --writepid "${pid}" \ + --explicit-exit-notify 3 > "$log" & + + sleep 1 + + if ! [ -r "$pid" ] || [ -z "$pid" ]; then + echo "ERROR: failed to start server $server_name" + tail -n 20 "$log" fi } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 2 Gerrit-Owner: mattock Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: cron2 Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-MessageType: newpatchset --YfWb7gFQYvg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, flichtenheld, plaisthos. <= /p>

mattock uploaded patch set #2 to this change.

View Change=

The following approvals got outdated and were removed: Code-Review-1 by flichtenheld

t_server_null: print error when server startu=
p fails

The --daemon option has to be at the end of the command-line= . Moreover,
if a pid-file is not found or is empty, launch a new server= instance
without --log or --daemon so that the error message is printed= properly.

Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3
S= igned-off-by: Samuli Sepp=C3=A4nen <samuli.seppanen@...277...>
---=
M tests/t_server_null_default.rc
M tests/t_server_null_server.sh
= 2 files changed, 13 insertions(+), 15 deletions(-)

git pull ssh:=
//gerrit.openvpn.net:29418/openvpn refs/changes/24/1024/2
diff --=
git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc
index 5b74761..1f2fa2c 100755
--- a/tests/t_serv= er_null_default.rc
+++ b/tests/t_server_null_default.rc
@@ -38,7 +38,7 @@
MAX_CLIENTS=3D"10"= ;
CLIENT_MATCH=3D"Test-Client"
= SERVER_EXEC=3D"${top_builddir}/src/openvpn/openvpn"
-SERVER_BASE_OPTS=3D"--daemon -= -dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb = 3 --duplicate-cn"

- if [ -z "${RUN_SUDO}" ]; then
- "${server_exec}" = \

- $server_con= f \
- --status = "${status}" 1 \
- --log "${log}" \
- --writepid "${pid}" \
- --explicit-exit-notify 3
- else
- $RUN_SUDO "${server_exec}&= quot; \
- = $server_conf \
- = --status "${status}" 1 \
- --log "${log}"= \
- = --writepid "${pid}" \
- --explicit-exit-notify 3
+ # Try to launch the server
= + $RUN_SUDO "${server_e= xec}" \
+ = $server_conf \
+ --writepid "${pid}&qu= ot; \
+ = --explicit-exit-notify 3 > "$log" &
+
+ sleep 1
+
+ if ! [ -= r "$pid" ] || [ -z "$pid" ]; then
+ echo "ERROR: failed to start= server $server_name"
+ tail -n 20 "$log"
fi }


To view, v= isit cha= nge 1024. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9= 487c8541d83c3
Gerrit-Change-Number: 1024
Gerrit-PatchSet: 2
Gerrit-Owner: mattock <sasepp@...2783...>= ;
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: cron2 <gert@...1296...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: cron2 <gert@...1296...>= ;
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-MessageType: newpatchset
--YfWb7gFQYvg=--