From: Russ Allbery Date: Sun, 17 Apr 2005 04:09:13 +0000 (+0000) Subject: * Add a check to afs-newcell to ensure the local hostname doesn't X-Git-Tag: debian/1.3.81-4~5 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=f41d97d6b8659c4bb65448932afcdc890baba157;p=packages%2Fo%2Fopenafs.git * Add a check to afs-newcell to ensure the local hostname doesn't resolve to 127.0.0.1. (Closes: #163751) --- diff --git a/debian/afs-newcell b/debian/afs-newcell index b896f000d..d411dc5a5 100644 --- a/debian/afs-newcell +++ b/debian/afs-newcell @@ -7,6 +7,7 @@ use Term::ReadLine; use strict; use Debian::OpenAFS::ConfigUtils; use Getopt::Long; +use Socket qw(inet_ntoa); use vars qw($admin $server $requirements_met $shutdown_needed); my $rl = new Term::ReadLine('afs-newcell'); @@ -111,6 +112,15 @@ print "If the fileserver is not running, this may hang for 30 seconds.\n"; run("/etc/init.d/openafs-fileserver stop"); $server = `hostname`; chomp $server; +my $ip = gethostbyname $server; +if (inet_ntoa ($ip) eq '127.0.0.1') { + print "Your hostname $server resolves to 127.0.0.1, which AFS cannot\n"; + print "cope with. Make sure your hostname resolves to a non-loopback\n"; + print "IP address. (Check /etc/hosts and make sure that your hostname\n"; + print "isn't listed on the 127.0.0.1 line. If it is, removing it from\n"; + print "that line will probably solve this problem.)\n"; + exit(1); +} $admin = $rl->readline("What administrative principal should be used? ") unless $admin; die "Please specify an administrative user\n" unless $admin; $admin =~ s:/:.:g; diff --git a/debian/changelog b/debian/changelog index 0040c07e7..b5f58c8ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ openafs (1.3.81-4) UNRELEASED; urgency=low * Put the compiled modules into KPKG_DEST_DIR if set. This appears to be preferred over DEB_DEST by the make-kpkg documentation. Thanks, Jonas Smedegaard. (Closes: #206403) + * Add a check to afs-newcell to ensure the local hostname doesn't + resolve to 127.0.0.1. (Closes: #163751) --