PDA

View Full Version : hostname by dhcp (PARTIALLY SOLVED)



bvsantos
10-22-2007, 09:41 AM
Hi all.

I'm using Knoppix to boot from PXE and have a prompt in every machine i use. the machines are registered in a dhcp server and their hostname is set by whatever dhcp gives. with knoppix that is not happening.

After remastering the Knoppix files, i've commented out the line in the knoppix autoconfigure script that sets the hostname to Knoppix, but still i don't have the hostname defined.
In the same autoconfigure script of knoppix, in the line that the script pulls up the ethernet interfaces with pump, i've read the man page and added the following option
--lookup-hostname but no sucess...

In the config file of dhcpc
/etc/dhcpc/config (in a chroot environment), i've defined -h (even -H) as an option, but still no results...

I need the hostname defined so i can performe other operations in the machine...

Cheers,

Bruno

bvsantos
10-22-2007, 05:18 PM
Hi. It's partially done.

After changing root to the knoppix, as described in the remastering howto, i've replaced the pump with dhcpcd. I've installed dhcpcd (which apt automatically removes pump).

Edited the knoppix-configure script in /etc/init.d/ and replaced the pump command with dhcpcd.

IMPORTANT: during the removel process, a question is placed - if you want to remove the files in the /etc/dhcpc. i've answered yes, but a problem arise when booting. it's necessary to recreate in that directory the resolv.conf file. a simple touch resolv.conf is enough.
Edit the config file and where it says SET_HOSTNAME=no change to yes and uncomment the line. everything should be fine.

After that, booting with PXE and execute hostname give's me the computer hostname as it's defined in the dhcp. :D

The problem cames now when rebooting. it sends the kill signals but it hangs... before installing dhcpcd everything was fine, but now i beliave it's because dhcpc-bin (which is executed by dhcpcd).

Cheers,

Bruno