Jie Gao wrote:


On Sat, 6 Mar 2004, Stas Bekman wrote:


Date: Sat, 06 Mar 2004 15:25:35 -0800
From: Stas Bekman <[EMAIL PROTECTED]>
To: Jie Gao <[EMAIL PROTECTED]>
Cc: mod_perl Mailing List <[EMAIL PROTECTED]>
Subject: Re: [RELEASE CANDIDATE] please test mod_perl-1.99_13-dev.tar.gz:
   make test failes on solaris 9

Jie Gao wrote:
[...]

I've got it work. What I did was to comment out the ipv6 entry in Solaris's
Internet host table:

% more /etc/inet/ipnodes
#
# Internet host table
#
#::1            localhost
127.0.0.1       localhost

/etc/nsswitch.conf has the following as default:

ipnodes: files

Nevertheless, it seems some system call was used not correctly to resolve
an IPv4 address.

Very good, Jie. Any idea how we could test at the test configuration time whether your ipv6 config is proper and that the resolving will work during the test time? let's say you unedit that file. Could you adjust A-T to figure things out, or at least suggest to the user what's wrong?


Solaris claims IPv6 is off by default; so this one is a bug. There are a couple
of ways of getting around this on Solaris in your test script:

1. Use 127.0.0.1 instead of localhost. IPv6's use is very rare anyway.

That's changing quickly. We get more and more reports because of ipv6.


2. Ping localhost. If it fails, ask the user to check the loopback interface,
  with the suggestion that /etc/inet/ipnodes should be checked:

---------------------------------------------------------------------------
my $sys_name = `/bin/uname -s`;
   chomp $sys_name;

if (defined $sys_name && $sys_name eq 'SunOS') {
    my $release = `/bin/uname -r`;
    chomp $release;
    if (defined $release && $release >= 5.8) {
        my $ret = 0xffff & system('/usr/sbin/ping localhost 3 > /dev/null 2>&1');
        unless ($ret == 0) {
            print "localhost is down. Please check your loopback interface. Look into 
/etc/inet/ipnodes and
if you are not using IPv
6, comment out the line \"::1  localhost\" and try this test again.\n";

        }
    }
}

That's great, Jie. Could you rewrite it not to use any external applications, but pure perl? The problem with external apps is that args and location vary from platform to platfrom and even from one release to another. Also using perl we won't need to write a separate implementation for each platform. e.g. $^O tells you the OS name. Not sure what's the best way to implement a quick simple ping, CPAN has a few implementations but if we can avoid creating extra dependencies at this level that would be great. Perhaps creating a pair of sockets (local and INET) could make for a quick test.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to