← Back to team overview

registry team mailing list archive

[Bug 10239] Re: dhcp3-client: Does not send hostname to server by default

 

Dec. 2010;  bug is still present in Mint Linux Debian Edition.
A nice way to fix this would be to modify dhclient, adding a function to its Data Expression parser called, something like, hostname that would simply return the client's hostname.  Or, solve this and the whole class of related problems in one blow by adding a more generic function called shell, which would take a shell command string as its argument and return the string output to stdout as its result.  With such a "shell" function, one could simply add the following to the dhclient.conf file:

send host-name = shell "hostname -s"  #the -s suppresses any domain name

Such functions would be straightforward extensions. See man page dhcp-
eval.5 for details on "Data Expressions".  I don't understand the
earlier comment that "the program doesn't work this way"

But, given that the upstream maintainers do not seem to be readily
accepting patches, I have resorted to the simple hack of rewriting the
dhclient.conf file just before dhclient starts.

#   mv  /etc/dhcp/dhclient.conf  /etc/dhcp/dhclient.base
#   mv  /sbin/dhclient  /sbin/dhclient.original
#   save the attached script to /sbin/dhclient
#   chmod +x /sbin/dhclient

After you do this, just remember that dhclient.conf will be rewritten.
Make any configuration changes in dhclient.base instead.

If the upstream devs indicate that they are interested in accepting the
Data Function patches described above, I would be willing to submit
them.  However, I won't investigate further until the basic idea is
discussed and accepted.  Otherwise, the effort is just wasting
everyone's time. (mostly mine :-)


** Attachment added: "Script automate sending current hostname by rewriting dhclient.conf"
   https://bugs.launchpad.net/debian/+source/dhcp3/+bug/10239/+attachment/1765383/+files/dhclient

-- 
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for Debian.
https://bugs.launchpad.net/bugs/10239

Title:
  dhcp3-client: Does not send hostname to server by default