From 47127455271affc577e6e789d7a1cee13b5b94d1 Mon Sep 17 00:00:00 2001 From: Jesse Weaver Date: Mon, 18 Aug 2008 12:37:55 -0500 Subject: [PATCH] fix for bug 2528: installation fails with confusing error message This makes the dns check happen earlier, and fail humanely if there is a problem. Signed-off-by: Galen Charlton --- rewrite-config.PL | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rewrite-config.PL b/rewrite-config.PL index 69b070a687..6167c5ee00 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -64,7 +64,11 @@ $myhost = hostname(); $mydomain = $myhost; $mydomain =~ s/^.*?\.//; # This is set here to rescue systems with broken DNS -$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa(scalar gethostbyname($myhost||'localhost')) || die "Cannot get our own IP address: DNS fault?"; +if ( !gethostbyname( $myhost || 'localhost' ) ) { + die 'Could not get the IP address of ' . ( $myhost || 'localhost' ) . ', DNS fault?'; +} + +$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa( scalar gethostbyname( $myhost||'localhost' ) ); $prefix = $ENV{'INSTALL_BASE'} || "/usr"; # These are our configuration guesses -- 2.20.1