James Richard Tyrer wrote: > On 03/27/2012 05:40 AM, Ken Moffat wrote: >> On Tue, Mar 27, 2012 at 05:06:37AM -0700, James Richard Tyrer wrote: >>> On 03/24/2012 09:08 AM, Ken Moffat wrote: >>>> On Sat, Mar 24, 2012 at 12:33:05AM -0700, James Richard Tyrer wrote: >>>>> Small things can be very annoying department. >>>>> >>>>> I find that when I start : "dhclient" with the: "network" init.d script >>>>> that the host-name of my computer is changed to: "dhcppc<n>". I have >>>>> looked through the documentation and can not seem to find out how to >>>>> prevent this.
You need to set up /etc/dhclient.conf. Do not request a host-name. >>>>> It would be nice if this page of the book addressed this problem. >>>> I haven't seen this problem. I use dhclient with the following in >>>> /etc/sysconfig/ifconfig.eth0: >>>> >>>> ONBOOT=yes >>>> IFACE=eth0 >>>> SERVICE="dhclient" >>>> DHCP_START="-1 eth0" >>>> DHCP_STOP="-r" >>>> >>>> and my hostname is what I set in /etc/sysconfig/network. >>>> >>> Yes, I have: >>> >>> HOSTNAME=`cat /etc/hostname` >>> >>> in /etc/sysconfig/network. But, dhclient isn't using that. >>> >>> Is it possible that something like: >>> >>> hostname $HOSTNAME >>> >>> is being executed somewhere on your system? >>> >> Well, the first difference is that I don't have /etc/hostname. The HOSTNAME environment variable can be set in /etc/sysconfig/rc.site or /etc/sysconfig/network. The one in network takes precedence. >> Coincidentally, while I was googling for something else to do with >> dhcp yesterday, I came upon a page which claimed that dhclient does >> NOT use a default hostname if one is offered, in the way that e.g. >> dhcpcd apparently does. When dhclient gets an IP address, it runs the script /sbin/dhclient-script by default. Depending on what it gets from the server, the hostname is set there. > This is odd. It is setting the hostname before running dhclient. Yes, that's what localnet does, but it can be overridden by the dhcp client. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
