In #233159 and above Russ Dill writes:
> if you want to close the bug quickly, just add some commented lines to
> the appropriate portion of the script, something to the effect of:
> 
> #if [ -n $hostname ] ; then
> #     echo $hostname > /etc/hostname
> #     hostname $hostname
> #fi


The DHCP client should never write /etc/hostname.  It should only set
the current hostname (using the hostname command or the sethostname()
function).


Marco d'Itri wrote:
> I never suggested that this should be the default behaviour of DHCP
> clients, only that if an user is expecting to have the hostname assigned
> with DHCP then he'd better configure his client to do this.


Right.

FYI, some quick checking leads me to believe that the default of
dhclient3 is to set the hostname to the value returned by the DHCP
server.

/etc/dhcp3/dhclient-script:
    ...
    set_hostname() {
        local current_hostname=$(hostname)
        if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ]; then
            hostname "$new_host_name"
        fi
    }
    ...
    case "$reason" in
    ...
    BOUND|RENEW|REBIND|REBOOT)
        set_hostname


On the other hand, the default for dhcpcd seems to be _not_ to set the hostname.

/etc/dhcpc/config:
    # Uncomment this to allow dhcpcd to set hostname of the host to the
    # hostname option supplied by DHCP server.
    #SET_HOSTNAME='yes'


And pump never sets the hostname.

    /tmp/src/pump-0.8.21$ find . -exec grep -s gethostname \{\} \; -print
            gethostname(hostname, sizeof(hostname));
            gethostname(hostname, sizeof(hostname));
            gethostname(reqHostname, 200);
    ./dhcp.c
    - if no hostname is specified on the command line, use gethostname()
    ./pump.spec
      * Make sure gethostname results are null-terminated (closes: #77975).
    ./debian/changelog
    /tmp/src/pump-0.8.21$ find . -exec grep -s sethostname \{\} \; -print
    /tmp/src/pump-0.8.21$

(In RedHat I believe that pump does set the hostname via a proxy script,
but pump has no proxy script in Debian.)

-- 
Thomas Hood <[EMAIL PROTECTED]>



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to