[Ovirt-devel] [PATCH server] verify hostname is not on the loopback entry in /etc/hosts
Joey Boggs
jboggs at redhat.com
Wed Mar 25 19:21:06 UTC 2009
To prevent kerberos errors the fqdn must never be on the loopback entry
---
installer/bin/ovirt-installer | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/installer/bin/ovirt-installer b/installer/bin/ovirt-installer
index a2aae9f..28b269c 100755
--- a/installer/bin/ovirt-installer
+++ b/installer/bin/ovirt-installer
@@ -96,6 +96,20 @@ welcome = "This installer will configure the ovirt installation based on a seri
of questions. When complete, you will be asked to install oVirt or\n\
do the installation manually. Would you like to continue?"
+# verify hostname is not on the loopback line in /etc/hosts to prevent kerberos problems
+hostname = `hostname`
+hostsfile = File.new("/etc/hosts", "r")
+while (line = hostsfile.gets)
+ if line =~ /127.0.0.1/ && line.include?(hostname.chomp)
+ if hostname !~ /localhost.localdomain/
+ @cli.say("\nHostname must not be on the loopback 127.0.0.1 line in /etc/hosts")
+ @cli.say("#{line}")
+ exit(0)
+ end
+ end
+end
+hostsfile.close
+
if (prompt_yes_no(welcome, :default => "y") == "n")
exit(0)
end
--
1.6.0.6
More information about the ovirt-devel
mailing list