Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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 <galen.charlton@liblime.com>
  • Loading branch information...
commit 47127455271affc577e6e789d7a1cee13b5b94d1 1 parent 6e53a31
Jesse Weaver authored Galen Charlton committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 rewrite-config.PL
View
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.