]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use `hostname` for DHCP_HOSTNAME in ifcfg-eth0 569/head
authorLenz Grimmer <lenz@grimmer.com>
Fri, 12 Jun 2015 23:08:41 +0000 (01:08 +0200)
committerLenz Grimmer <lenz@grimmer.com>
Tue, 16 Jun 2015 12:00:49 +0000 (14:00 +0200)
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 5e1f50be7a4f5ea334e64ae68c21a42e95b3eeba..946eb5ced634ad545af5c689c7afa1ca2f34256c 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 013546ad9f257a82a48ae3e1f517af0fcc53d465..7faa9398a4a3368b5a8a229f9424c0492c0877e5 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