[OpenIndiana-discuss] extra entry in /etc/hosts after each reboot

wim at vandenberge.us wim at vandenberge.us
Mon Jun 17 20:14:00 UTC 2013


Thanks for the useful responses everyone. As one of the responses I received P2P
mentioned, it turned out to be a fairly welknown issue with the snippet below in
the agent-bootinit.pl script that comes with napp-it and not an OpenIndiana
issue at all.

Regards,

W


# check/update /etc/hosts: 127.0.0.1  hostname (old hostname missing)
   my $ok=`hostname`;
   $r=`cat /etc/hosts`; $r=~s/\n+/\n/gs;
   @t=(); @t=split(/\n/,$r);
   foreach my $t (@t) {
        if ($t=~/^127.0.0.1\s+$ok\b/) { $ok="1"; last; }
   }
   if ($ok ne "1") {
        push (@t,"127.0.0.1\t$ok\n");
        $t=join("\n", at t);
        open (PF, ">/etc/hosts");
              print PF "$t";
        close (PF);
   }








> On June 17, 2013 at 3:55 PM Roel_D <openindiana at out-side.nl> wrote:
>
>
> Aren't NWam and /network/default running together?
>
> Kind regards,
>
> The out-side
>
> Op 17 jun. 2013 om 20:16 heeft James Carlson <carlsonj at workingcode.com> het
> volgende geschreven:
>
> > On 06/17/13 11:59, wim at vandenberge.us wrote:
> >> At this point the interface is plumbed with the 127.0.0.1 address and the
> >> machine is essentially unreachable over the network. This machine is a
> >> plain
> >> OpenIndiana install with napp-it on it.
> >>
> >> Its replica, installed at the same time and configured identically, is not
> >> exhibiting this kind of behavior. I've been searching where during start-up
> >> this
> >> is occurring but have not been able to find anything yet.
> >
> > A few ideas in no particular order:
> >
> > 1. Right after one of these "bad" boots, do an "ls -l /etc/inet/hosts"
> > to find out when the file was modified. Then do "svcs -s stime" to find
> > out what service(s) were started at around the time the file was
> > touched. Then go look at the method scripts for the suspicious ones.
> >
> > 2. Assuming it's a "normal" method of some sort that's doing this, grep
> > around in /lib/svc/method/*.
> >
> > 3. Try one of the napp-it lists to see if someone there knows about this
> > sort of behavior. I haven't seen it, and all of the old-school
> > automatic hosts file modifications I've seen have always had an
> > automatically-generated "# ..." comment describing the source of the
> > change, so this sounds like something newish.
> >
> > --
> > James Carlson 42.703N 71.076W <carlsonj at workingcode.com>
> >
> > _______________________________________________
> > OpenIndiana-discuss mailing list
> > OpenIndiana-discuss at openindiana.org
> > http://openindiana.org/mailman/listinfo/openindiana-discuss
>
> _______________________________________________
> OpenIndiana-discuss mailing list
> OpenIndiana-discuss at openindiana.org
> http://openindiana.org/mailman/listinfo/openindiana-discuss


More information about the OpenIndiana-discuss mailing list