[pkg-dhcp-devel] Bug#792854: isc-dhcp-client: Dhclient fails to set hostname

Иван Прокудин ivan at prokudin.org
Mon Nov 21 13:49:36 UTC 2016


Hello!

I've also faced the bug. And it's also mentioned here: 
http://blog.schlomo.schapiro.org/2013/11/setting-hostname-from-dhcp-in-debian.html .

It's caused incorrect if in file /sbin/dhclient-script

I've made a patch that fixed the issue for me:

--- /root/dhclient-script       2016-11-20 07:05:32.145715966 +0300
+++ /sbin/dhclient-script       2016-11-20 07:31:06.581734208 +0300
@@ -98,10 +98,9 @@
         if [ -z "$current_hostname" ] ||
            [ "$current_hostname" = '(none)' ] ||
            [ "$current_hostname" = 'localhost' ] ||
-           [ "$current_hostname" = "$old_host_name" ]; then
-           if [ "$new_host_name" != "$old_host_name" ]; then
-               hostname "$new_host_name"
-           fi
+           ([ "$current_hostname" = "$old_host_name" ] &&
+           [ "$new_host_name" != "$old_host_name" ]); then
+               hostname "$new_host_name"
         fi
     fi
 }

Will be glad if debian includes it in a package resolving the issue.

With best regards, Ivan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-dhcp-devel/attachments/20161121/344c050c/attachment.sig>


More information about the pkg-dhcp-devel mailing list