From: "cron2 (Code Review)" Date: Fri, 9 Jan 2026 17:20:35 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <2202bef0bac53b74bef98e065d4308b6466892ad-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="OPljIzE735k="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: configure.ac: Clean up systemd support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --OPljIzE735k= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1463?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by plaisthos Change subject: configure.ac: Clean up systemd support ...................................................................... configure.ac: Clean up systemd support - Do not try to handle very old systemd that was released over ten years ago (remove SYSTEMD_NEWER_THAN_216) - Do not require systemd.pc. I can't find any indication that we use any of the variables defined by it. (It does not define any libraries, just variables) - Remove check for sd-daemon.h. We did not use the conditional and assumed it was there already. - Allow libsystemd.pc to define cflags. Previously we ignored those. Change-Id: Ie59e03ce01575acaeaf690f582eb5cfa80eb37fc Signed-off-by: Frank Lichtenheld Acked-by: Arne Schwabe Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1463 Message-Id: <20260109163514.23051-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg35= 203.html Signed-off-by: Gert Doering --- M config.h.cmake.in M configure.ac M src/openvpn/Makefile.am M src/openvpn/console_systemd.c M src/openvpn/init.c 5 files changed, 7 insertions(+), 28 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/63/1463/2 diff --git a/config.h.cmake.in b/config.h.cmake.in index 01bbadc..53976a7 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -284,9 +284,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYSLOG_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYSTEMD_SD_DAEMON_H - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_EPOLL_H @@ -374,9 +371,6 @@ /* Path to systemd-ask-password tool */ #undef SYSTEMD_ASK_PASSWORD_PATH -/* systemd is newer than v216 */ -#define SYSTEMD_NEWER_THAN_216 - /* The tap-windows id */ #define TAP_WIN_COMPONENT_ID "tap0901" diff --git a/configure.ac b/configure.ac index 8ba5673..63d4d6e 100644 --- a/configure.ac +++ b/configure.ac @@ -1139,28 +1139,14 @@ dnl AM_CONDITIONAL([ENABLE_SYSTEMD], [test "${enable_systemd}" =3D "yes"]) if test "$enable_systemd" =3D "yes" ; then - PKG_CHECK_MODULES([libsystemd], [systemd libsystemd], + PKG_CHECK_MODULES([libsystemd], [libsystemd > 216], [], - [PKG_CHECK_MODULES([libsystemd], [libsystemd-daemon]= )] + [AC_MSG_ERROR([systemd enabled but libsystemd is mis= sing])] ) - PKG_CHECK_EXISTS([libsystemd > 216], - [AC_DEFINE([SYSTEMD_NEWER_THAN_216], [1], - [systemd is newer than v216])] - ) - - AC_CHECK_HEADERS(systemd/sd-daemon.h, - , - [ - AC_MSG_ERROR([systemd development headers not found.]) - ]) - - saved_LIBS=3D"${LIBS}" - LIBS=3D"${LIBS} ${libsystemd_LIBS}" - AC_CHECK_FUNCS([sd_booted], [], [AC_MSG_ERROR([systemd library is miss= ing sd_booted()])]) + OPTIONAL_SYSTEMD_CFLAGS=3D"${libsystemd_CFLAGS}" OPTIONAL_SYSTEMD_LIBS=3D"${libsystemd_LIBS}" AC_DEFINE(ENABLE_SYSTEMD, 1, [Enable systemd integration]) - LIBS=3D"${saved_LIBS}" if test -n "${SYSTEMD_UNIT_DIR}"; then systemdunitdir=3D"${SYSTEMD_UNIT_DIR}" @@ -1377,6 +1363,7 @@ AC_SUBST([OPTIONAL_LZO_LIBS]) AC_SUBST([OPTIONAL_LZ4_CFLAGS]) AC_SUBST([OPTIONAL_LZ4_LIBS]) +AC_SUBST([OPTIONAL_SYSTEMD_CFLAGS]) AC_SUBST([OPTIONAL_SYSTEMD_LIBS]) AC_SUBST([OPTIONAL_PKCS11_HELPER_CFLAGS]) AC_SUBST([OPTIONAL_PKCS11_HELPER_LIBS]) diff --git a/src/openvpn/Makefile.am b/src/openvpn/Makefile.am index 19c21c0f..c879585 100644 --- a/src/openvpn/Makefile.am +++ b/src/openvpn/Makefile.am @@ -28,6 +28,7 @@ $(OPTIONAL_LIBNL_GENL_CFLAGS) \ $(OPTIONAL_LZO_CFLAGS) \ $(OPTIONAL_LZ4_CFLAGS) \ + $(OPTIONAL_SYSTEMD_CFLAGS) \ $(OPTIONAL_PKCS11_HELPER_CFLAGS) \ $(OPTIONAL_INOTIFY_CFLAGS) \ -DPLUGIN_LIBDIR=3D\"${plugindir}\" \ diff --git a/src/openvpn/console_systemd.c b/src/openvpn/console_systemd.c index d277bd4..9588b95 100644 --- a/src/openvpn/console_systemd.c +++ b/src/openvpn/console_systemd.c @@ -61,13 +61,10 @@ struct argv argv =3D argv_new(); argv_printf(&argv, SYSTEMD_ASK_PASSWORD_PATH); -#ifdef SYSTEMD_NEWER_THAN_216 - /* the --echo support arrived in upstream systemd 217 */ if (echo) { argv_printf_cat(&argv, "--echo"); } -#endif argv_printf_cat(&argv, "--icon network-vpn"); argv_printf_cat(&argv, "--timeout=3D0"); argv_printf_cat(&argv, "%s", prompt); diff --git a/src/openvpn/init.c b/src/openvpn/init.c index c014a91..b690dff 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1545,7 +1545,7 @@ #else #ifdef ENABLE_SYSTEMD sd_notifyf(0, "STATUS=3DFailed to start up: %s With Errors\nERRNO= =3D1", message); -#endif /* HAVE_SYSTEMD_SD_DAEMON_H */ +#endif msg(M_INFO, "%s With Errors", message); #endif } @@ -5052,4 +5052,4 @@ packet_id_free(&c->c2.crypto_options.packet_id); context_gc_free(c); -} \ No newline at end of file +} -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1463?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie59e03ce01575acaeaf690f582eb5cfa80eb37fc Gerrit-Change-Number: 1463 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --OPljIzE735k= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by flichtenhel= d.

View Change

The following approvals got outdated and were remove= d: Code-Review+2 by plaisthos

configure.ac: Clean up systemd =
support

- Do not try to handle very old systemd that was released over ten years ago (remove SYSTEMD_NEWER_THAN_216)
- Do not require s= ystemd.pc. I can't find any indication
that we use any of the vari= ables defined by it. (It
does not define any libraries, just variables= )
- Remove check for sd-daemon.h. We did not use the
conditional an= d assumed it was there already.
- Allow libsystemd.pc to define cflags. = Previously we
ignored those.

Change-Id: Ie59e03ce01575acaeaf690= f582eb5cfa80eb37fc
Signed-off-by: Frank Lichtenheld <frank@...2641...= >
Acked-by: Arne Schwabe <arne-openvpn@...1227...>
Gerrit UR= L: https://gerrit.openvpn.net/c/openvpn/+/1463
Message-Id: <202601091= 63514.23051-1-gert@...1296...>
URL: https://www.mail-archive.com/open= vpn-devel@lists.sourceforge.net/msg35203.html
Signed-off-by: Gert Doerin= g <gert@...1296...>
---
M config.h.cmake.in
M configure.acM src/openvpn/Makefile.am
M src/openvpn/console_systemd.c
M src/ope= nvpn/init.c
5 files changed, 7 insertions(+), 28 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/chang=
es/63/1463/2
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 01bbadc..53976a7 100644
--- a/config.h.c= make.in
+++ b/config.h.cmake.in
@@ -284,9 += 284,6 @@
/* Define to 1 if you have the <syslog.h> h= eader file. */
#cmakedefine HAVE_SYSLOG_H
=
-/* Define to 1 if yo= u have the <systemd/sd-daemon.h> header file. */
-#undef HAVE_SYSTEMD_SD_DAEMON_H
= -
/* Define to 1= if you have the <sys/epoll.h> header file. */
#cmak= edefine HAVE_SYS_EPOLL_H

@@ -374,9 +371,6= @@
/* Path to systemd-ask-password tool */
#undef SYSTEMD_ASK_PASSWORD_PATH


-/* systemd is newer than v216 */
= -#define SYSTEMD_NEWER_THAN_216
-
/* Th= e tap-windows id */
#define TAP_WIN_COMPONENT_ID "tap= 0901"

diff --git a/configure.ac b/co= nfigure.ac
index 8ba5673..63d4d6e 100644
--= - a/configure.ac
+++ b/configure.ac
@@ -113= 9,28 +1139,14 @@
dnl
AM_CONDITIONAL([ENAB= LE_SYSTEMD], [test "${enable_systemd}" =3D "yes"])
if test "$enable_systemd" =3D "yes" ; then=
- PKG_CHECK_MODULES= ([libsystemd], [systemd libsystemd],
+ PKG_CHECK_MODULES([libsystemd], [libsystemd > 216],=
[],
- [PKG_CHECK_MODULES([libsystemd]= , [libsystemd-daemon])]
+ [AC_MSG_ERROR([systemd enabled but libsystemd is = missing])]
)

- PKG_CHECK_EXISTS([libsy= stemd > 216],
- = [AC_DEFINE([SYSTEMD_NEWER_THAN_216], [1],
- [systemd is = newer than v216])]
- = )
-
- AC_CHECK_HEADERS(sys= temd/sd-daemon.h,
- = ,
- [- AC_MSG_ERROR([systemd deve= lopment headers not found.])
- ])
-
- saved_LIBS=3D"${L= IBS}"
- LIBS=3D= "${LIBS} ${libsystemd_LIBS}"
- AC_CHECK_FUNCS([sd_booted], [], [AC_MSG_ERROR([systemd= library is missing sd_booted()])])
+ OPTIONAL_SYSTEMD_CFLAGS=3D"${libsystemd_CFLAGS}&qu= ot;
OPTIONAL_SYSTEMD_LIBS=3D"${libsystemd_LIBS}&q= uot;
AC_DEFINE(ENABLE_SYSTEMD, 1, [Enable systemd inte= gration])
- LIBS=3D&= quot;${saved_LIBS}"

if test -n = "${SYSTEMD_UNIT_DIR}"; then
systemdunitd= ir=3D"${SYSTEMD_UNIT_DIR}"
@@ -1377,6 +1363,7 @@<= /span>
AC_SUBST([OPTIONAL_LZO_LIBS])
AC_SUBST([O= PTIONAL_LZ4_CFLAGS])
AC_SUBST([OPTIONAL_LZ4_LIBS])<= br>+AC_SUBST([OPTIONAL_SYSTEMD_= CFLAGS])
AC_SUBST([OPTIONAL_SYSTEMD_LIBS])
AC_SUBST([OPTIONAL_PKCS11_HELPER_CFLAGS])

AC_SUBST([OPTI= ONAL_PKCS11_HELPER_LIBS])
diff --git a/src/openvpn/Makefile= .am b/src/openvpn/Makefile.am
index 19c21c0f..c879585 10064= 4
--- a/src/openvpn/Makefile.am
+++ b/src/o= penvpn/Makefile.am
@@ -28,6 +28,7 @@
$(OP= TIONAL_LIBNL_GENL_CFLAGS) \
$(OPTIONAL_LZO_CFLAGS) \
$(OPTIONAL_LZ4_CFLAGS) \
+ $(OPTIONAL_SYSTEMD_CFLAGS) \
$(OPTION= AL_PKCS11_HELPER_CFLAGS) \
$(OPTIONAL_INOTIFY_CFLAGS) \
-DPLUGIN_LIBDIR=3D\"${plugindir}\" \
<= span>diff --git a/src/openvpn/console_systemd.c b/src/openvpn/console_syste= md.c

index d277bd4..9588b95 100644
--- a/sr= c/openvpn/console_systemd.c
+++ b/src/openvpn/console_syste= md.c
@@ -61,13 +61,10 @@
struct argv a= rgv =3D argv_new();

argv_printf(&= ;argv, SYSTEMD_ASK_PASSWORD_PATH);
-#ifdef SYSTEMD_NEWER_THAN_216
- /* the --echo support arrived in upstream systemd = 217 */
if (echo)
{
argv_printf_cat(&argv, "--echo");

= }
-#endif argv_printf_cat(&argv, "--icon network-vpn");
argv_printf_cat(&argv, "--timeout=3D0");
argv_printf_cat(&argv, "%s", prompt);
diff --git a/src/openvpn/init.c b/src/openvpn/init.cindex c014a91..b690dff 100644
--- a/src/openvpn/init= .c
+++ b/src/openvpn/init.c
@@ -1545,7 +154= 5,7 @@
#else
#ifdef ENABLE_SYSTEMD=
sd_notifyf(0, "STATUS=3DFailed to start up: %s With= Errors\nERRNO=3D1", message);
-#endif /* HAVE_SYSTEMD_SD_DAEMON_H */
+#endif
msg(M_INF= O, "%s With Errors", message);
#endif
= }
@@ -5052,4 +5052,4 @@
pac= ket_id_free(&c->c2.crypto_options.packet_id);

context_gc_free(c);
-}
\ No newline at end of file
+}


To view, visit change 1463. To unsubscribe, or for help writing mail filter= s, visit setting= s.

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie59e03ce01575acaeaf690f582e= b5cfa80eb37fc
Gerrit-Change-Number: 1463
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --OPljIzE735k=--