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. > >> > >> 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. But yes, /etc/rcS.d/S08localnet sources the network file and then runs hostname. That's on an LFS-7.0 system, but this has worked for me for years and years (since at least LFS-6.3).
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. From my current boot.log: -------- Mar 27 13:21:26 +01:00 (none) Mounting virtual file systems: /run /proc /sys OK Mar 27 13:21:26 +01:00 (none) Loading modules: i2c-viapro OK Mar 27 13:21:26 +01:00 (none) Bringing up the loopback interface... OK Mar 27 13:21:26 +01:00 (none) Setting hostname to bluesbreaker... OK Mar 27 13:21:26 +01:00 bluesbreaker Populating /dev with device nodes... OK Mar 27 13:21:29 +01:00 bluesbreaker Activating all swap files/partitions... OK Mar 27 13:21:29 +01:00 bluesbreaker Mounting root file system in read-only mode... OK Mar 27 13:21:29 +01:00 bluesbreaker Checking file systems... OK Mar 27 13:21:30 +01:00 bluesbreaker Remounting root file system in read-write mode... OK Mar 27 13:21:30 +01:00 bluesbreaker Recording existing mounts in /etc/mtab... OK Mar 27 13:21:30 +01:00 bluesbreaker Mounting remaining file systems... OK Mar 27 13:21:30 +01:00 bluesbreaker Cleaning file systems: /tmp OK Mar 27 13:21:30 +01:00 bluesbreaker Creating files and directories... OK Enabling ondemand cpu frequency Mar 27 13:21:30 +01:00 bluesbreaker Retrying failed uevents, if any... OK Mar 27 13:21:30 +01:00 bluesbreaker Setting up Linux console... OK Mar 27 13:21:31 +01:00 bluesbreaker Starting system log daemon... OK Mar 27 13:21:31 +01:00 bluesbreaker Starting kernel log daemon... OK Mar 27 13:21:32 +01:00 bluesbreaker Starting the D-Bus Messagebus Daemon... OK Mar 27 13:21:32 +01:00 bluesbreaker Bringing up the eth0 interface: Mar 27 13:21:32 +01:00 bluesbreaker Starting dhclient on the eth0 interface... OK Mar 27 13:21:36 +01:00 bluesbreaker Starting rpcbind OK (and so forth) ĸen -- das eine Mal als Tragödie, das andere Mal als Farce -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page