From 41a8add4fa879a2890127f0d325e301be3f8bb4e Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Aug 22 2019 15:50:55 +0000 Subject: 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. Not submitted upstream, because I have no idea how to. --- diff --git a/cloud-init-17.1-nm_dispatcher_dir.patch b/cloud-init-17.1-nm_dispatcher_dir.patch new file mode 100644 index 0000000..86262a0 --- /dev/null +++ b/cloud-init-17.1-nm_dispatcher_dir.patch @@ -0,0 +1,60 @@ +From bb1b5831acb49976a088433390d44e1dcb9f2fb2 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Thu, 22 Aug 2019 15:52:42 +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. +--- + doc/rtd/topics/datasources/azure.rst | 2 +- + packages/redhat/cloud-init.spec.in | 2 +- + setup.py | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/doc/rtd/topics/datasources/azure.rst b/doc/rtd/topics/datasources/azure.rst +index b41cddd9..2156a3c4 100644 +--- a/doc/rtd/topics/datasources/azure.rst ++++ b/doc/rtd/topics/datasources/azure.rst +@@ -37,7 +37,7 @@ To find the endpoint, we now leverage the dhcp client's ability to log its + known values on exit. The endpoint server is special DHCP option 245. + Depending on your networking stack, this can be done + by calling a script in /etc/dhcp/dhclient-exit-hooks or a file in +-/etc/NetworkManager/dispatcher.d. Both of these call a sub-command ++/usr/lib/NetworkManager/dispatcher.d. Both of these call a sub-command + 'dhclient_hook' of cloud-init itself. This sub-command will write the client + information in json format to /run/cloud-init/dhclient.hook/.json. + +diff --git a/packages/redhat/cloud-init.spec.in b/packages/redhat/cloud-init.spec.in +index 057a5784..a4ec3dbe 100644 +--- a/packages/redhat/cloud-init.spec.in ++++ b/packages/redhat/cloud-init.spec.in +@@ -186,7 +186,7 @@ fi + %attr(0755, root, root) %{_initddir}/cloud-init + %endif + +-%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager ++%{_prefix}/lib/NetworkManager/dispatcher.d/hook-network-manager + %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient + + # Program binaries +diff --git a/setup.py b/setup.py +index fcaf26ff..cc25ed8e 100755 +--- a/setup.py ++++ b/setup.py +@@ -261,9 +261,9 @@ data_files = [ + ] + if os.uname()[0] != 'FreeBSD': + data_files.extend([ +- (ETC + '/NetworkManager/dispatcher.d/', +- ['tools/hook-network-manager']), + (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']), ++ (USR + '/lib/NetworkManager/dispatcher.d/', ++ ['tools/hook-network-manager']), + (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')]) + ]) + # Use a subclass for install that handles +-- +2.23.0 + diff --git a/cloud-init.spec b/cloud-init.spec index a84336e..f03aaaa 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 17.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Cloud instance init scripts License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -29,6 +29,9 @@ Patch5: cloud-init-17.1-exclude_EPOCHREALTIME.patch # platform.dist has been removed in Pyton 3.8. Patch6: cloud-init-17.1-deprecated_platform_dist.patch +# Move the NetworkManager dispatcher script out of /etc +Patch7: cloud-init-17.1-nm_dispatcher_dir.patch + BuildArch: noarch BuildRequires: pkgconfig(systemd) @@ -83,6 +86,9 @@ Requires: xfsprogs %{?systemd_requires} +# Old NetworkManager expects the dispatcher scripts in a different place +Conflicts: NetworkManager < 1.20 + %description Cloud-init is a set of init scripts for cloud instances. Cloud instances @@ -146,7 +152,7 @@ nosetests-%{python3_version} tests/unittests/ %config(noreplace) %{_sysconfdir}/cloud/templates/* %dir %{_sysconfdir}/rsyslog.d %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf -%{_sysconfdir}/NetworkManager/dispatcher.d/hook-network-manager +%{_prefix}/lib/NetworkManager %{_sysconfdir}/dhcp/dhclient-exit-hooks.d/hook-dhclient /lib/udev/rules.d/66-azure-ephemeral.rules %{_unitdir}/cloud-config.service @@ -165,6 +171,9 @@ nosetests-%{python3_version} tests/unittests/ %changelog +* Thu Aug 22 2019 Lubomir Rintel - 17.1-13 +- Move the NetworkManager dispatcher script out of /etc + * Sun Aug 18 2019 Miro HronĨok - 17.1-12 - Rebuilt for Python 3.8