]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use `hostname` for DHCP_HOSTNAME in ifcfg-eth0
authorLenz Grimmer <lenz@grimmer.com>
Fri, 12 Jun 2015 23:08:41 +0000 (01:08 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 1 Jul 2015 17:49:09 +0000 (13:49 -0400)
Updated centos/fedora/oracle templates to use `hostname` for DHCP_HOSTNAME in
/etc/sysconfig/network/ifcfg-eth0, so the container's host name is propagated
to the host's DHCP server (e.g. dnsmasq, which also acts as the DNS server).
This resolves lxc/lxd#756

Signed-off-by: Lenz Grimmer <lenz@grimmer.com>
templates/lxc-centos.in
templates/lxc-fedora.in
templates/lxc-oracle.in

index adabe7cb6beee67ffcf3f3da293f5803d232e286..1a27cd35883609a07a48e6f56bd3e443f533753d 100644 (file)
@@ -253,7 +253,7 @@ HOSTNAME=${UTSNAME}
 NM_CONTROLLED=no
 TYPE=Ethernet
 MTU=${MTU}
-DHCP_HOSTNAME=$name
+DHCP_HOSTNAME=\`hostname\`
 EOF
 
     # set the hostname
index e33ba337ece6995165236145bff34999edb97b74..b90ec14c87f68059cd67a2f85024773cde3879f7 100644 (file)
@@ -226,6 +226,7 @@ DEVICE=eth0
 BOOTPROTO=dhcp
 ONBOOT=yes
 HOSTNAME=${utsname}
+DHCP_HOSTNAME=\`hostname\`
 NM_CONTROLLED=no
 TYPE=Ethernet
 MTU=${MTU}
index 13fad95dbd6e62553a9e4abbb876ac8d7d2658b6..fbd0fd2ead6b23417b868d39350fdfecab7de52a 100644 (file)
@@ -336,7 +336,7 @@ DEVICE=eth0
 BOOTPROTO=dhcp
 ONBOOT=yes
 HOSTNAME=$name
-DHCP_HOSTNAME=$name
+DHCP_HOSTNAME=\`hostname\`
 NM_CONTROLLED=no
 TYPE=Ethernet
 EOF