[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>
  

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