#3 Move the NetworkManager dispatcher script out of /etc
Closed 17 days ago by lkundrak. Opened 24 days ago by lkundrak.
rpms/ lkundrak/dnssec-trigger lr/nm-dispatcher-dir  into  master

@@ -0,0 +1,96 @@ 

+ From 6e13ba9b4367fb7867f8a61930bd80b34970aa34 Mon Sep 17 00:00:00 2001

+ From: Lubomir Rintel <lkundrak@v3.sk>

+ Date: Thu, 22 Aug 2019 16:28:51 +0200

+ Subject: [PATCH] Move the NetworkManager dispatcher script out of /etc

+ 

+ It's not user configuration and shouldn't ever have been there. Except for that

+ it used to be the only location NetworkManager looked into. With NetworkManager

+ 1.20 that is no longer the case and the dispatcher scripts can be moved to

+ /usr/lib.

+ 

+ Users of older NetworkManager versions can still override this on the

+ ./configure command line.

+ ---

+  README       |  2 +-

+  configure    | 10 +++++-----

+  configure.ac |  8 ++++----

+  3 files changed, 10 insertions(+), 10 deletions(-)

+ 

+ diff --git a/README b/README

+ index 1ddc3f4..7093268 100644

+ --- a/README

+ +++ b/README

+ @@ -74,7 +74,7 @@ the secure version, but this was fixed in 0.6.

+  

+  * unix - NetworkManager

+  

+ -In /etc/NetworkManager/dispatcher.d a script sends DHCP changes to

+ +In /usr/lib/NetworkManager/dispatcher.d a script sends DHCP changes to

+  the daemon.  The script is a networkmanager dhcp hook script and uses

+  dnssec-trigger-control to talk to the daemon.  The script uses nmcli

+  to find the DNS info.

+ diff --git a/configure b/configure

+ index 16d86fc..1efddd3 100755

+ --- a/configure

+ +++ b/configure

+ @@ -1364,8 +1364,8 @@ Optional Packages:

+                            'windows' or 'none'

+    --with-networkmanager-dispatch

+                            Set the networkmanager dhcp dispatcher dir, default

+ -                          tests prefix/etc/NetworkManager/dispatcher.d and

+ -                          /etc/NetworkManager/dispatcher.d

+ +                          tests prefix/lib/NetworkManager/dispatcher.d and

+ +                          /lib/NetworkManager/dispatcher.d

+    --with-netconfig-dispatch

+                            Set the netconfig dhcp dispatcher dir, default tests

+                            prefix/etc/netconfig.d and /etc/netconfig.d

+ @@ -6879,7 +6879,7 @@ if test -n "$withval"; then

+  fi

+  

+  # hook settings

+ -networkmanager_dispatcher_dir="$sysconfdir/NetworkManager/dispatcher.d"

+ +networkmanager_dispatcher_dir="$prefix/lib/NetworkManager/dispatcher.d"

+  

+  # Check whether --with-networkmanager-dispatch was given.

+  if test "${with_networkmanager_dispatch+set}" = set; then :

+ @@ -6938,8 +6938,8 @@ $as_echo_n "checking for NetworkManager dispatch... " >&6; }

+  	else

+  		if test -d "$networkmanager_dispatcher_dir" ; then

+  			:

+ -		else if test -d /etc/NetworkManager/dispatcher.d; then

+ -			networkmanager_dispatcher_dir="/etc/NetworkManager/dispatcher.d"

+ +		else if test -d /lib/NetworkManager/dispatcher.d; then

+ +			networkmanager_dispatcher_dir="/lib/NetworkManager/dispatcher.d"

+  			fi

+  		fi

+  	fi

+ diff --git a/configure.ac b/configure.ac

+ index f06412f..d1b8556 100644

+ --- a/configure.ac

+ +++ b/configure.ac

+ @@ -244,9 +244,9 @@ if test -n "$withval"; then

+  fi

+  

+  # hook settings

+ -networkmanager_dispatcher_dir="$sysconfdir/NetworkManager/dispatcher.d"

+ +networkmanager_dispatcher_dir="$prefix/lib/NetworkManager/dispatcher.d"

+  AC_ARG_WITH([networkmanager-dispatch], AC_HELP_STRING([--with-networkmanager-dispatch],

+ -	[Set the networkmanager dhcp dispatcher dir, default tests prefix/etc/NetworkManager/dispatcher.d and /etc/NetworkManager/dispatcher.d]),

+ +	[Set the networkmanager dhcp dispatcher dir, default tests prefix/lib/NetworkManager/dispatcher.d and /lib/NetworkManager/dispatcher.d]),

+  	, withval="")

+  with_nm_dispatch="$withval"

+  AC_SUBST(networkmanager_dispatcher_dir)

+ @@ -290,8 +290,8 @@ if test "$hooks" = "networkmanager"; then

+  	else

+  		if test -d "$networkmanager_dispatcher_dir" ; then

+  			:

+ -		else if test -d /etc/NetworkManager/dispatcher.d; then

+ -			networkmanager_dispatcher_dir="/etc/NetworkManager/dispatcher.d"

+ +		else if test -d /lib/NetworkManager/dispatcher.d; then

+ +			networkmanager_dispatcher_dir="/lib/NetworkManager/dispatcher.d"

+  			fi

+  		fi

+  	fi

+ -- 

+ 2.23.0

+ 

file modified
+17 -5

@@ -5,7 +5,7 @@ 

  Summary: Tool for dynamic reconfiguration of validating resolver Unbound

  Name: dnssec-trigger

  Version: 0.15

- Release: 9%{?svn_snapshot:.%{svn_snapshot}svn}%{?dist}

+ Release: 10%{?svn_snapshot:.%{svn_snapshot}svn}%{?dist}

  License: BSD

  Url: http://www.nlnetlabs.nl/downloads/dnssec-trigger/

  

@@ -22,21 +22,22 @@ 

  # Patches

  Patch1: 0001-dnssec-trigger-script-port-to-libnm.patch

  Patch2: 0002-Fix-that-NXDOMAIN-for-_probe.uk.uk-is-deemed-allrigh.patch

+ Patch3: 0003-Move-the-NetworkManager-dispatcher-script-out-of-etc.patch

  

  # to obsolete the version in which the panel was in main package

  Obsoletes: %{name} < 0.12-22

  Suggests: %{name}-panel

  # Require a version of NetworkManager that doesn't forget to issue dhcp-change

  # https://bugzilla.redhat.com/show_bug.cgi?id=1112248

- %if 0%{?rhel} >= 7

+ %if 0%{?rhel} >= 9 || 0%{?fedora} >= 31

+ Requires: NetworkManager >= 1.20

+ %elif 0%{?rhel} >= 7

  Requires: NetworkManager >= 0.9.9.1-13

- %else

- %if 0%{?fedora} >= 21

+ %el%if 0%{?fedora} >= 21

  Requires: NetworkManager >= 0.9.9.95-1

  %else

  Requires: NetworkManager >= 0.9.9.0-40

  %endif

- %endif

  Requires: ldns >= 1.6.10, NetworkManager-libnm, unbound

  # needed by /usr/sbin/dnssec-trigger-control-setup

  # otherwise it ends with error: /usr/sbin/dnssec-trigger-control-setup: line 180: openssl: command not found

@@ -82,6 +83,7 @@ 

  

  %patch1 -p1 -b .libnm_port

  %patch2 -p1 -b .nxdomain

+ %patch3 -p1 -b .nm_dispatcher_dir

  

  # don't use DNSSEC for forward zones for now

  sed -i "s/validate_connection_provided_zones=yes/validate_connection_provided_zones=no/" dnssec.conf

@@ -91,6 +93,9 @@ 

  %configure  \

      --with-keydir=%{_sysconfdir}/dnssec-trigger \

      --with-hooks=networkmanager \

+ %if 0%{?rhel} < 9 && 0%{?fedora} < 31

+     --with-networkmanager-dispatch=%{_sysconfdir}/NetworkManager/dispatcher.d \

+ %endif

      --with-python=%{__python3} \

      --with-pidfile=%{_localstatedir}/run/%{name}d.pid

  

@@ -163,7 +168,11 @@ 

  %{_libexecdir}/dnssec-trigger-script

  %{_unitdir}/%{name}d.service

  %{_unitdir}/%{name}d-keygen.service

+ %if 0%{?rhel} >= 9 || 0%{?fedora} >= 31

+ %attr(0755,root,root) %{_prefix}/lib/NetworkManager/dispatcher.d/01-dnssec-trigger

+ %else

  %attr(0755,root,root) %{_sysconfdir}/NetworkManager/dispatcher.d/01-dnssec-trigger

+ %endif

  %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/dnssec.conf

  %attr(0755,root,root) %dir %{_sysconfdir}/%{name}

  %attr(0644,root,root) %ghost %config(noreplace) %{_sysconfdir}/%{name}/dnssec-trigger.conf

@@ -182,6 +191,9 @@ 

  

  

  %changelog

+ * Thu Aug 22 2019 Lubomir Rintel <lkundrak@v3.sk> - 0.15-10

+ - Move the NetworkManager dispatcher script out of /etc

+ 

  * Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.15-9

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

  

It's not user configuration and shouldn't ever have been there. Except for that
it used to be the only location NetworkManager looked into. With NetworkManager
1.20 that is no longer the case and the dispatcher scripts can be moved to
/usr/lib.

Merging with the provenpackager hat on.

Pull-Request has been closed by lkundrak

17 days ago