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 [email protected]. 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 [email protected] 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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1466790

Title:
  dhclient does not remain running on boot

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

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to