dhcpcd and /etc/hosts

DJ Lucas dj at lucasit.com
Sun May 18 21:11:31 PDT 2003


Started to send to support, but then decided it better for dev given 
that I already fixed my problems, but the third one that I ran across...

Hola peeps, got a strange little problem.  Googed and checked the 
archives, but couldn't find a resolution.  Probably something minor, but 
can't put my finger on it.  At anyrate, I installed XFree86-4.3.0, and 
got a small error:

     root at Name2:/usr/sbin# startx
     hostname: Unknown host
     Using authority file /root/.Xauthority
     Writing authority file /root/.Xauthority

Turns out I was using the hostname from coreutils.  Deleted it, forcing 
the use of the one from net-tools, in /usr/bin.  That problem was fixed. 
  Then I got this:

     root at Name2:/usr/sbin# startx
     Using authority file /root/.Xauthority
     Writing authority file /root/.Xauthority
     xauth: (argv):1:  bad display name "Name2:0" in "list" command
     Using authority file /root/.Xauthority
     xauth: (stdin):1:  bad display name "Name2:0" in "add" command

So, I went back and checked the /etc/hosts file, from a quick clue 
handed me by google.  Sure enough, due to my truely creative naming 
scheme, I had the wrong name there (Name1), and the wrong IP address 
because I'm using DHCP.  Changed the name there, and problem solved.

Now, the part that goes to dev:

The error is gone, but what to do about the wrong IP address in 
/etc/hosts?  Using dhcpcd to grab an IP and not sure whether this is a 
problem or not.  If X is looking at the wrong IP address in that file, 
what harm can this cause?  To set up the hosts file dynamically, where 
in the init scripts is that file going to be used (by anything), or is 
it even necessary to fix this?  I touched on this a long time ago in a 
hint, but I never saw any problems with it, so it was forgoten.  It 
wouldn't be that difficult to add 3 commands, a hostname command, source 
the .info file, and a do a sed on /etc/hosts, to ifup-eth0 to fix the 
file, I just need to know where it's important that the IP be correct 
and be certain that this does no harm and only good.

Thanks,

DJ

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-dev' in the subject header of the message



More information about the blfs-dev mailing list