[Openvpn-devel,v1] t_client.sh.in: Do not run resolvectl if systemd is not running

Message ID 20260713151816.22005-1-gert@greenie.muc.de
State New
Headers
Series [Openvpn-devel,v1] t_client.sh.in: Do not run resolvectl if systemd is not running |

Commit Message

Gert Doering July 13, 2026, 3:18 p.m. UTC
  From: Frank Lichtenheld <frank@lichtenheld.com>

In some cases we will have resolvectl installed but no
running systemd. E.g. on old Ubuntu distros resolvectl
is part of the main systemd package which we have installed
as a build-dependency.

Supress the warnings from resolvectl in this case.

Change-Id: I677d3206c24aad997889ed76fb8eca2e6f4b1259
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1778
---

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/+/1778
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <gert@greenie.muc.de>
  

Comments

Gert Doering July 14, 2026, 9:36 a.m. UTC | #1
Are Linux distributions not great to code for... but anyway, this is
a reasonable addition, avoiding non-useful error message in test output
in that scenario, and harmless otherwise.

Your patch has been applied to the master and release/2.7 branch
("improve test infra").

commit 162f19112702d1c8045efd17c5b09022fe1e04fb (master)
commit 2e63ed332ea80e6e4b344ab426ce34f74aa4de95 (release/2.7)
Author: Frank Lichtenheld
Date:   Mon Jul 13 17:18:11 2026 +0200

     t_client.sh.in: Do not run resolvectl if systemd is not running

     Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1778
     Message-Id: <20260713151816.22005-1-gert@greenie.muc.de>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg37566.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering
  

Patch

diff --git a/tests/t_client.sh.in b/tests/t_client.sh.in
index 5bf9dbb..52f2a0d 100755
--- a/tests/t_client.sh.in
+++ b/tests/t_client.sh.in
@@ -243,7 +243,7 @@ 
     # except Linux and MacOS
     case $UNAME in
 	Linux)
-            if [ -x /usr/bin/resolvectl ] ; then
+            if [ -x /usr/bin/resolvectl -a -d /run/systemd/system ] ; then
                 echo "-- linux resolvectl --"
                 resolvectl status
             else