]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Condition to HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV is reversed 10982/head
authorOtto <otto.moerbeek@open-xchange.com>
Mon, 15 Nov 2021 10:48:22 +0000 (11:48 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Wed, 1 Dec 2021 11:20:16 +0000 (12:20 +0100)
builder-support/specs/pdns-recursor.spec
builder-support/specs/pdns.spec
m4/systemd.m4
pdns/Makefile.am
pdns/recursordist/Makefile.am

index db73951d30b4234e47b2ef698129eae9686427ef..b806482df399bc23cc160b64ee22ed3c09a9bbd7 100644 (file)
@@ -73,6 +73,14 @@ sed -i \
     -e 's/# setgid=/setgid=pdns-recursor/' \
     %{buildroot}%{_sysconfdir}/%{name}/recursor.conf
 
+# The EL7 and 8 systemd actually supports %t, but its version number is older than that, so we do use seperate runtime dirs, but don't rely on RUNTIME_DIRECTORY
+%if 0%{?rhel} < 9
+sed -e 's!/pdns_recursor!& --socket-dir=%t/pdns-recursor!' -i %{buildroot}/%{_unitdir}/pdns-recursor.service
+%if 0%{?rhel} < 8
+sed -e 's!/pdns_recursor!& --socket-dir=%t/pdns-recursor-%i!' -e 's!RuntimeDirectory=pdns-recursor!&-%i!' -i %{buildroot}/%{_unitdir}/pdns-recursor@.service
+%endif
+%endif
+
 %pre
 getent group pdns-recursor > /dev/null || groupadd -r pdns-recursor
 getent passwd pdns-recursor > /dev/null || \
index e0b29c15fd0989685473efadd0153ba072a881ad..86bdc752d8e65db56de9c8605ca724d243331739 100644 (file)
@@ -225,6 +225,14 @@ chmod 600 %{buildroot}%{_sysconfdir}/%{name}/pdns.conf
 %{__mv} %{buildroot}/%{_bindir}/zone2ldap %{buildroot}/%{_bindir}/pdns-zone2ldap
 %{__mv} %{buildroot}/%{_mandir}/man1/zone2ldap.1 %{buildroot}/%{_mandir}/man1/pdns-zone2ldap.1
 
+# The EL7 and 8 systemd actually supports %t, but its version number is older than that, so we do use seperate runtime dirs, but don't rely on RUNTIME_DIRECTORY
+%if 0%{?rhel} < 9
+sed -e 's!/pdns_server!& --socket-dir=%t/pdns!' -i %{buildroot}/%{_unitdir}/pdns.service
+%if 0%{?rhel} < 8
+sed -e 's!/pdns_server!& --socket-dir=%t/pdns-%i!' -e 's!RuntimeDirectory=pdns!&-%i!' -i %{buildroot}/%{_unitdir}/pdns@.service
+%endif
+%endif
+
 %check
 PDNS_TEST_NO_IPV6=1 make %{?_smp_mflags} -C pdns check || (cat pdns/test-suite.log && false)
 
@@ -378,4 +386,4 @@ systemctl daemon-reload ||:
 %{_sysconfdir}/%{name}/ixfrdist.example.yml
 %{_unitdir}/ixfrdist.service
 %{_unitdir}/ixfrdist@.service
-%endif
\ No newline at end of file
+%endif
index 3c8f196783737bdc7a7e40a2b0463e45b8bd6a52..66dc62cdeb80c390083f8e8eb73d52e92e6b45c6 100644 (file)
@@ -174,6 +174,9 @@ AC_DEFUN([AX_CHECK_SYSTEMD_FEATURES], [
                  # @aio, @sync, @chown, @setuid, @memlock, @signal and @timer in 235
                  systemd_system_call_filter=y
               fi
+              if test $_systemd_version -ge 236; then
+                 systemd_percent_t=y
+              fi
               if test $_systemd_version -ge 239; then
                  systemd_private_mounts=y
               fi
@@ -195,6 +198,7 @@ AC_DEFUN([AX_CHECK_SYSTEMD_FEATURES], [
         AM_CONDITIONAL([HAVE_SYSTEMD_DYNAMIC_USER], [ test x"$systemd_dynamic_user" = "xy" ])
         AM_CONDITIONAL([HAVE_SYSTEMD_LOCK_PERSONALITY], [ test x"$systemd_lock_personality" = "xy" ])
         AM_CONDITIONAL([HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE], [ test x"$systemd_memory_deny_write_execute" = "xy" ])
+        AM_CONDITIONAL([HAVE_SYSTEMD_PERCENT_T], [ test x"$systemd_percent_t" = "xy" ])
         AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_DEVICES], [ test x"$systemd_private_devices" = "xy" ])
         AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_MOUNTS], [ test x"$systemd_private_mounts" = "xy" ])
         AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_TMP], [ test x"$systemd_private_tmp" = "xy" ])
index 2c979e10e8793584e40cd362948f0d7667db3e98..004c8becfedcaaa09dfa202ffd7a63fb22e45d3a 100644 (file)
@@ -1664,8 +1664,10 @@ if HAVE_SYSTEMD
 pdns.service: pdns.service.in
        $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' -e 's![@]service_user[@]!$(service_user)!' -e 's![@]service_group[@]!$(service_group)!' < $< > $@
 if !HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV
+if HAVE_SYSTEMD_PERCENT_T
        $(AM_V_GEN)sed -e 's!/pdns_server!& --socket-dir=%t/pdns!' -i $@
 endif
+endif
 if !HAVE_SYSTEMD_LOCK_PERSONALITY
        $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
 endif
@@ -1724,12 +1726,14 @@ endif
 pdns@.service: pdns.service
        $(AM_V_GEN)sed -e 's!/pdns_server!& --config-name=%i!' \
          -e 's!Authoritative Server!& %i!' \
-         -e 's!RuntimeDirectory=.*!&-%i!' \
          -e 's!SyslogIdentifier=.*!&-%i!' \
          < $< > $@
+if HAVE_SYSTEMD_PERCENT_T
+       $(AM_V_GEN)sed -e 's!RuntimeDirectory=.*!&-%i!' -i $@
 if !HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV
        $(AM_V_GEN)sed -e 's!--socket-dir=[^ ]\+!&-%i !' -i $@
 endif
+endif
 
 systemdsystemunitdir = $(SYSTEMD_DIR)
 
index 98df6482a2059b2493f9fe1ee063c4fdeb738fbc..d1829d4b179f5c30af907cd48c79e290b5562977 100644 (file)
@@ -545,8 +545,10 @@ if HAVE_SYSTEMD
 pdns-recursor.service: pdns-recursor.service.in
        $(AM_V_GEN)sed -e 's![@]sbindir[@]!$(sbindir)!' -e 's![@]service_user[@]!$(service_user)!' -e 's![@]service_group[@]!$(service_group)!' < $< > $@
 if !HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV
+if HAVE_SYSTEMD_PERCENT_T
        $(AM_V_GEN)sed -e 's!/pdns_recursor!& --socket-dir=%t/pdns-recursor!' -i $@
 endif
+endif
 if !HAVE_SYSTEMD_LOCK_PERSONALITY
        $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
 endif
@@ -605,12 +607,14 @@ endif
 pdns-recursor@.service: pdns-recursor.service
        $(AM_V_GEN)sed -e 's!/pdns_recursor!& --config-name=%i!' \
          -e 's!Recursor!& %i!' \
-         -e 's!RuntimeDirectory=.*!&-%i!' \
          -e 's!SyslogIdentifier=.*!&-%i!' \
          < $< > $@
+if HAVE_SYSTEMD_PERCENT_T
+       $(AM_V_GEN)sed -e 's!RuntimeDirectory=.*!&-%i!' -i $@
 if !HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV
        $(AM_V_GEN)sed -e 's!--socket-dir=[^ ]\+!&-%i !' -i $@
 endif
+endif
 
 systemdsystemunitdir = $(SYSTEMD_DIR)