From 010f6405288b1ca519d684d85ca25ce86de60b66 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Tue, 19 Sep 2017 12:06:39 +0300 Subject: [PATCH] Make sure upgrade also checks for IPv6 stack - Add check for IPv6 stack to upgrade process - Change IPv6 checker to also check that localhost resolves to ::1 Part of fixes https://pagure.io/freeipa/issue/7083 Reviewed-By: Tomas Krizek --- ipaplatform/redhat/tasks.py | 19 ++++++++++++++++--- ipaserver/install/server/upgrade.py | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py index 07efebab97eabcf2dc39bd345920a1c7be56e9f5..94d1863c5cc20ec6c2399f339ce19498976553bc 100644 --- a/ipaplatform/redhat/tasks.py +++ b/ipaplatform/redhat/tasks.py @@ -153,9 +153,22 @@ class RedHatTaskNamespace(BaseTaskNamespace): """ if not os.path.exists(paths.IF_INET6): raise RuntimeError( - "IPv6 kernel module has to be enabled. If you do not wish to " - "use IPv6, please disable it on the interfaces in " - "sysctl.conf and enable the IPv6 kernel module.") + "IPv6 stack has to be enabled in the kernel and some " + "interface has to have ::1 address assigned. Typically " + "this is 'lo' interface. If you do not wish to use IPv6 " + "globally, disable it on the specific interfaces in " + "sysctl.conf except 'lo' interface.") + + try: + localhost6 = ipautil.CheckedIPAddress('::1', allow_loopback=True) + if localhost6.get_matching_interface() is None: + raise ValueError("no interface for ::1 address found") + except ValueError: + raise RuntimeError( + "IPv6 stack is enabled in the kernel but there is no " + "interface that has ::1 address assigned. Add ::1 address " + "resolution to 'lo' interface. You might need to enable IPv6 " + "on the interface 'lo' in sysctl.conf.") def restore_pre_ipa_client_configuration(self, fstore, statestore, was_sssd_installed, diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py index 0947766c076251e7608241803d3a1eabee65ae11..1c4b2357d5d016b8a7501f46380d5e0a61dc21a0 100644 --- a/ipaserver/install/server/upgrade.py +++ b/ipaserver/install/server/upgrade.py @@ -1860,6 +1860,7 @@ def upgrade_configuration(): def upgrade_check(options): try: installutils.check_server_configuration() + tasks.check_ipv6_stack_enabled() except RuntimeError as e: root_logger.error(e) sys.exit(1) -- 2.13.5