1
0
mirror of https://github.com/rancher/os.git synced 2025-08-16 05:54:51 +00:00

Set hostname from DHCP (broken)

This adds the proper variable we need to set the hostname from DHCP. End
to end this does not work though.  The hostname does not propagate
outside the container.  More changes need to be done for this.
This commit is contained in:
Darren Shepherd 2015-04-08 07:38:09 -07:00
parent dc4f1d432d
commit 106fb36c8c

View File

@ -116,7 +116,7 @@ func ApplyNetworkConfigs(netCfg *config.NetworkConfig) error {
func applyNetConf(link netlink.Link, netConf config.InterfaceConfig) error {
if netConf.DHCP {
log.Infof("Running DHCP on %s", link.Attrs().Name)
cmd := exec.Command("dhcpcd", "-A4H", link.Attrs().Name)
cmd := exec.Command("dhcpcd", "-A4", "-e", "force_hostname=true", link.Attrs().Name)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {