From: mattock (C. Review) <ge...@op...> - 2025-05-16 07:20:47
|
Attention is currently required from: flichtenheld, plaisthos. Hello plaisthos, flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email to review the following change. 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änen <sam...@gm...> --- M tests/t_server_null_default.rc M tests/t_server_null_server.sh 2 files changed, 22 insertions(+), 11 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/24/1024/1 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="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_BIND_OPTS="--local 127.0.0.1" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..d8fd1c4 100755 --- a/tests/t_server_null_server.sh +++ b/tests/t_server_null_server.sh @@ -11,20 +11,31 @@ # 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 + # Try to launch the server daemonized + $RUN_SUDO "${server_exec}" \ + $server_conf \ + --status "${status}" 1 \ + --log "${log}" \ + --writepid "${pid}" \ + --explicit-exit-notify 3 \ + --daemon + + sleep 1 + + # With --daemon OpenVPN's exit code is always 0, even when it failed to + # start. Therefore we check the pid-file and if it is missing or is empty + # we run OpenVPN without --daemon and --log to catch the underlying error. + # By backgrounding the process in the shell we ensure that we don't block + # the test run in the (unlikely) case that OpenVPN startup actually + # succeeds. + if ! [ -r "$pid" ] || [ -z "$pid" ]; then + echo "ERROR: failed to start server $server_name" + $RUN_SUDO "${server_exec}" \ $server_conf \ --status "${status}" 1 \ - --log "${log}" \ --writepid "${pid}" \ - --explicit-exit-notify 3 + --explicit-exit-notify 3 & fi } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 1 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-MessageType: newchange |
From: flichtenheld (C. Review) <ge...@op...> - 2025-05-19 11:45:47
|
Attention is currently required from: mattock, plaisthos. flichtenheld has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) Change subject: t_server_null: print error when server startup fails ...................................................................... Patch Set 1: Code-Review-1 (1 comment) File tests/t_server_null_server.sh: http://gerrit.openvpn.net/c/openvpn/+/1024/comment/ba4b5841_b5256428 : PS1, Line 27: # we run OpenVPN without --daemon and --log to catch the underlying error. This doesn't explain why we can't use the log file from the failed startup? Please elaborate. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 1 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: mattock <sa...@pr...> Gerrit-Comment-Date: Mon, 19 May 2025 11:45:31 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment |
From: mattock (C. Review) <ge...@op...> - 2025-05-20 11:51:26
|
Attention is currently required from: flichtenheld, plaisthos. mattock has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) Change subject: t_server_null: print error when server startup fails ...................................................................... Patch Set 1: (1 comment) File tests/t_server_null_server.sh: http://gerrit.openvpn.net/c/openvpn/+/1024/comment/864a35bd_87c44e01 : PS1, Line 27: # we run OpenVPN without --daemon and --log to catch the underlying error. > This doesn't explain why we can't use the log file from the failed startup? Please elaborate. I can't remember the impact of --log, so I need to test again. I vaguely recall nothing ever going to the logs if the startup fails. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 1 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-Comment-Date: Tue, 20 May 2025 11:51:11 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: flichtenheld <fr...@li...> Gerrit-MessageType: comment |
From: cron2 (C. Review) <ge...@op...> - 2025-05-20 20:44:04
|
Attention is currently required from: flichtenheld, mattock, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) Change subject: t_server_null: print error when server startup fails ...................................................................... Patch Set 1: (1 comment) File tests/t_server_null_server.sh: http://gerrit.openvpn.net/c/openvpn/+/1024/comment/10e6f7d1_701a039c : PS1, Line 27: # we run OpenVPN without --daemon and --log to catch the underlying error. > I can't remember the impact of --log, so I need to test again. […] This is correct, if cli parsing fails before logging is changed, you'll only see stdout/stderr Which is why t_client.sh uses ``` $RUN_SUDO "${openvpn}" $openvpn_conf >>$LOGDIR/$SUF:openvpn.log & ``` -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 1 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: cron2 <ge...@gr...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-Attention: mattock <sa...@pr...> Gerrit-Comment-Date: Tue, 20 May 2025 20:43:49 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: flichtenheld <fr...@li...> Comment-In-Reply-To: mattock <sa...@pr...> Gerrit-MessageType: comment |
From: mattock (C. Review) <ge...@op...> - 2025-05-24 04:13:00
|
Attention is currently required from: cron2, flichtenheld, plaisthos. mattock has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) Change subject: t_server_null: print error when server startup fails ...................................................................... Patch Set 1: (1 comment) File tests/t_server_null_server.sh: http://gerrit.openvpn.net/c/openvpn/+/1024/comment/70edd46b_0e03789c : PS1, Line 27: # we run OpenVPN without --daemon and --log to catch the underlying error. > This is correct, if cli parsing fails before logging is changed, you'll only see stdout/stderr […] I tested adding --log. And in case of OpenVPN startup failure we would get the error in the log. I used a duplicate management port in second server (11194 -> 11195) as a test specimen: "2025-05-24 07:04:19 MANAGEMENT: Socket bind failed on local address [AF_INET]127.0.0.1:11194: Address already in use (errno=98)" So we can either do "--log" and then tail the log, or we can just not do --log. The latter seems to be slightly more reliable as far as "getting all the output you might need"? -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 1 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: cron2 <ge...@gr...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: cron2 <ge...@gr...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-Comment-Date: Sat, 24 May 2025 04:12:39 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: cron2 <ge...@gr...> Comment-In-Reply-To: flichtenheld <fr...@li...> Comment-In-Reply-To: mattock <sa...@pr...> Gerrit-MessageType: comment |
From: mattock (C. Review) <ge...@op...> - 2025-06-10 15:18:30
|
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=email 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änen <sam...@gm...> --- 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="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_BIND_OPTS="--local 127.0.0.1" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_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=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 2 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: cron2 <ge...@gr...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: cron2 <ge...@gr...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-MessageType: newpatchset |
From: mattock (C. Review) <ge...@op...> - 2025-06-10 15:47:59
|
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=email to look at the new patch set (#3). Change subject: t_server_null: print error when server startup fails ...................................................................... t_server_null: print error when server startup fails Use "&" to background so that the exit code and all output can be obtained in all failure cases. Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Signed-off-by: Samuli Seppänen <sam...@gm...> --- 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/3 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="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_BIND_OPTS="--local 127.0.0.1" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..65b7d56 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" 2>&1 & + + 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=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 3 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: cron2 <ge...@gr...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: cron2 <ge...@gr...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-MessageType: newpatchset |
From: cron2 (C. Review) <ge...@op...> - 2025-06-18 14:11:33
|
Attention is currently required from: flichtenheld, mattock, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) Change subject: t_server_null: print error when server startup fails ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 3 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: cron2 <ge...@gr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-Attention: plaisthos <arn...@rf...> Gerrit-Attention: flichtenheld <fr...@li...> Gerrit-Attention: mattock <sa...@pr...> Gerrit-Comment-Date: Wed, 18 Jun 2025 14:11:24 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment |
From: Gert D. <ge...@gr...> - 2025-06-18 14:13:41
|
From: Samuli Seppänen <sam...@gm...> Use "&" to background so that the exit code and all output can be obtained in all failure cases. Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Signed-off-by: Samuli Seppänen <sam...@gm...> Acked-by: Gert Doering <ge...@gr...> --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1024 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering <ge...@gr...> 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="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_BIND_OPTS="--local 127.0.0.1" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..65b7d56 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" 2>&1 & + + sleep 1 + + if ! [ -r "$pid" ] || [ -z "$pid" ]; then + echo "ERROR: failed to start server $server_name" + tail -n 20 "$log" fi } |
From: Gert D. <ge...@gr...> - 2025-06-18 16:14:01
|
v3 looks good and does the job :-) - it needed a bit of massaging because the context has changed (commit 4d104a385) and because it really wants to go on top of #915 - but that's the wrong order, the "we want to see the failures?!" patch needs to go in before the one that triggers new failures... So, adjustments to t_server_null_default.rc to adapt to this. Your patch has been applied to the master branch. commit 378c2e2f2c155d92989f988b6fffb0e8980fa83d Author: Samuli Seppänen Date: Wed Jun 18 16:13:21 2025 +0200 t_server_null: print error when server startup fails Signed-off-by: Samuli Seppänen <sam...@gm...> Acked-by: Gert Doering <ge...@gr...> Message-Id: <202...@gr...> URL: https://www.mail-archive.com/ope...@li.../msg31932.html Signed-off-by: Gert Doering <ge...@gr...> -- kind regards, Gert Doering |
From: cron2 (C. Review) <ge...@op...> - 2025-06-18 16:14:26
|
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) Change subject: t_server_null: print error when server startup fails ...................................................................... t_server_null: print error when server startup fails Use "&" to background so that the exit code and all output can be obtained in all failure cases. Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Signed-off-by: Samuli Seppänen <sam...@gm...> Acked-by: Gert Doering <ge...@gr...> Message-Id: <202...@gr...> URL: https://www.mail-archive.com/ope...@li.../msg31932.html Signed-off-by: Gert Doering <ge...@gr...> --- M tests/t_server_null_default.rc M tests/t_server_null_server.sh 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc index 365b5a8..41ec591 100755 --- a/tests/t_server_null_default.rc +++ b/tests/t_server_null_default.rc @@ -38,7 +38,7 @@ MAX_CLIENTS="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --local 127.0.0.1 --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--local 127.0.0.1 --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" SERVER_CONF_BASE="${SERVER_BASE_OPTS} ${SERVER_CIPHER_OPTS} ${SERVER_CERT_OPTS}" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..65b7d56 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" 2>&1 & + + 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=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 4 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: cron2 <ge...@gr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-MessageType: merged |
From: cron2 (C. Review) <ge...@op...> - 2025-06-18 16:14:26
|
cron2 has uploaded a new patch set (#4) to the change originally created by mattock. ( http://gerrit.openvpn.net/c/openvpn/+/1024?usp=email ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: t_server_null: print error when server startup fails ...................................................................... t_server_null: print error when server startup fails Use "&" to background so that the exit code and all output can be obtained in all failure cases. Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Signed-off-by: Samuli Seppänen <sam...@gm...> Acked-by: Gert Doering <ge...@gr...> Message-Id: <202...@gr...> URL: https://www.mail-archive.com/ope...@li.../msg31932.html Signed-off-by: Gert Doering <ge...@gr...> --- 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/4 diff --git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc index 365b5a8..41ec591 100755 --- a/tests/t_server_null_default.rc +++ b/tests/t_server_null_default.rc @@ -38,7 +38,7 @@ MAX_CLIENTS="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --local 127.0.0.1 --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--local 127.0.0.1 --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" SERVER_CONF_BASE="${SERVER_BASE_OPTS} ${SERVER_CIPHER_OPTS} ${SERVER_CERT_OPTS}" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..65b7d56 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" 2>&1 & + + 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=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 Gerrit-Change-Number: 1024 Gerrit-PatchSet: 4 Gerrit-Owner: mattock <sa...@pr...> Gerrit-Reviewer: cron2 <ge...@gr...> Gerrit-Reviewer: flichtenheld <fr...@li...> Gerrit-Reviewer: plaisthos <arn...@rf...> Gerrit-CC: openvpn-devel <ope...@li...> Gerrit-MessageType: newpatchset |