← Back to team overview

touch-packages team mailing list archive

[Bug 1466790] Re: dhclient does not remain running on boot

 

I think I may have a clue now what the problem is. Incidentally on my
bare-metal servers the network interface seems to be brought up by
something else than the ifup@.service. The status there reports it
already up when the service runs. The same seems to be happening to MAAS
instances after initial deployment. On first login dhclient is not
running but after reboot it is, though then again the ifup@.service was
not starting the interface.

The problem looks to be that systemd acts differently on ExecStart and ExecStart[Pre|Post] elements. In Vivid we still had only a ExecStart element which was a shell  command running two ifup and some conditional ifquery command. In Wily this changed into a ExecStart which is ifup for hotplug and two ExecStartPost which are a second ifup (but this time for auto class) and an ifquery. The interface is brought up by the second ifup (as it is set to auto), but it seems systemd does not check/handle any processes started up in the background of a ExecStartPost.
So one way that fixed the dhclient issue was to exchange the hotplug and auto ifup calls, so auto was done in the ExecStart call. But that would only lead to problems if there was ever an interface in the hotplug class.

What seems to work for me (not sure this is all valid) is to make the
service oneshot and have multiple ExecStart elements, like this:

[Service]
Type=oneshot
ExecStart=/sbin/ifup --allow=hotplug %I
ExecStart=/sbin/ifup --allow=auto %I
ExecStart=/sbin/ifquery --state %I
ExecStop=/sbin/ifdown %I
RemainAfterExit=true

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/1466790

Title:
  dhclient does not remain running on boot

Status in ifupdown package in Ubuntu:
  New

Bug description:
  Not sure whether this is a systemd or ifupdown issue. I just happened to notice today for a Wily VM (set up from server iso) that I failed to get a DNS resolution for a VM I started earlier the day. DNS updates in my case are related to DHCP updates. And on the DHCP/DNS server I noticed that the IP address had been removed at some point. Looking at the VM, I find no dhclient being started. When I manually run ifdown and ifup on the interface this does happen. But not whenever I boot.
  Curious about this I also checked a Vivid VM (also server install) and this looks the same. However for Vivid this seems fixed in the latest versions.

  Network config in /etc/network/interfaces:
  auto eth0
  iface eth0 inet dhcp

  Expected result:
  dhclient running for eth0

  Actual result after boot:
  No dhclient process is running.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1466790/+subscriptions