Boot process takes too long when Ethernet is not connected

Bug #1431836 reported by Victor Mayoral
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

The boot process takes a minute with Internet access (e.g.: Ethernet) and several minutes when no Ethernet is connected. The kernel dump for the later is shown at https://gist.github.com/vmayoral/135aef30218b8d00d4f1.

Revision history for this message
Martin Pitt (pitti) wrote :

A minute is really long; can you please do "journalctl -b > journal.txt" and attach journal.txt here? Please do that for both cases (connected and not).

What do you have in your /etc/network/interfaces?

Changed in systemd (Ubuntu):
status: New → Incomplete
Revision history for this message
Victor Mayoral (vmayoral) wrote :

Martin,

Thanks for looking at this. The content of /etc/network/interfaces is:

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

Find attached the two files requested.
Kind regards,

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, I forgot about interfaces.d/ .. can you please give me the output of "grep -r . /etc/network/interfaces.d/" too?

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, this is snappy, this explains all the errors about read-only directories.

In the "with ethernet" case, boot started at 19:00:44, and eth0 DHCP is done at 19:00:57, so 13 s. Then it spends half a minute or so in cloud-init and click hooks, so that's not systemd's fault. So I consider the "with ethernet" case okay (feel free to report bugs against ubuntu-snappy against wasting all that time in cloud-init, though -- I don't think it ought to take that long except for the first boot).

In the "no ethernet" case, boot started at 19:00:44 too. That's really curious -- it's not the same file, so not just an attachment accident. Is there a problem with your clock or so? At 19:00:49 eth0 starts up, and then there are loots of repeated failed attempts to up it. At 19:01:15 (+31 s) cloud-init starts, at 19:02:53 (+2:09) eth0 gives up. Apparently at 19:06:02 you plugged in the ethernet cable? It seems to connect then, and reaches the "network" target. That's indeed buggy, network.target should be reached way earlier, the missing eth link should only block "networking.target".

So there are two issues here:

  - At the moment, snappy (or at least your image) is assuming ethernet connectivity, as you obviously have eth0 in /etc/network/interfaces.d/ somewhere (pending confirmation, see my previous question). In the future we probably want to make this more dynamic, using networkd or NetworkManager or something such.

 - Something there is blocking network.target on getting eth0 up, which is wrong. Can you please give me the output of "systemctl list-dependencies network.target"?

Revision history for this message
Oliver Grawert (ogra) wrote :

we dont have timesyncd support yet.
fixrtc kicks in and sets the clock to the last mount time so you dont end up with the clock set to the epoch (which is worse than only being off by the image install time at least) ...
if the mount time (as seen by dumpe2fs) didnt change between the two boots both logs will indeed show the 19:00:44 timestamp on boot ...

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, thanks Oli for the explanation, that explains the identical start time. Why isn't timesyncd working? I mean, I do see why it's not working if you pull the ethernet plug, but it should work fine if you are online?

Changed in snappy-ubuntu:
importance: Undecided → Low
Revision history for this message
Victor Mayoral (vmayoral) wrote :

Martin and Oliver,

Here're some things requested:

root@localhost:/home/ubuntu# grep -r . /etc/network/interfaces.d/
/etc/network/interfaces.d/usb0:auto usb0
/etc/network/interfaces.d/usb0:iface usb0 inet static
/etc/network/interfaces.d/usb0:address 192.168.7.2
/etc/network/interfaces.d/usb0:network 192.168.7.0
/etc/network/interfaces.d/usb0:netmask 255.255.255.0
/etc/network/interfaces.d/usb0:broadcast 192.168.7.255
/etc/network/interfaces.d/wlan0:auto wlan0
/etc/network/interfaces.d/wlan0:iface wlan0 inet static
/etc/network/interfaces.d/wlan0:address 10.0.0.1
/etc/network/interfaces.d/wlan0:network 10.0.0.0
/etc/network/interfaces.d/wlan0:netmask 255.255.255.0
/etc/network/interfaces.d/wlan0:broadcast 10.0.0.255
/etc/network/interfaces.d/eth0:allow-hotplug eth0
/etc/network/interfaces.d/eth0:iface eth0 inet dhcp
/etc/network/interfaces.d/wlan1:auto wlan1
/etc/network/interfaces.d/wlan1:iface wlan1 inet static
/etc/network/interfaces.d/wlan1:address 10.0.0.1
/etc/network/interfaces.d/wlan1:network 10.0.0.0
/etc/network/interfaces.d/wlan1:netmask 255.255.255.0
/etc/network/interfaces.d/wlan1:broadcast 10.0.0.255

and

root@localhost:/home/ubuntu# systemctl list-dependencies network.target
network.target

Furthermore, i can confirm that removing the "eth0" interface from "/etc/network/interfaces.d/" the time of boot (for the non Ethernet case) shrinks.

Regards,

Revision history for this message
Oliver Grawert (ogra) wrote :

i dont think timesyncd is seeded yet (or integrated in any way with if-up/-down atm). i know there was work going on in the snappy team to fix this though.

Revision history for this message
Martin Pitt (pitti) wrote :

@Oli: timesyncd is part of systemd, and it doesn't need any integration with ifupdown. It listens for coming and going network connections by itself and adjusts its wakeups according to network availability and precision of the clock. I specifically enabled this because the snappy team asked me to :-)

@Victor: indeed, so everything which is "auto" in /etc/network/interfaces/* is required for a complete boot. But I'm still confused why it's blocking network.target. What kind of install is that, standard snappy image on some laptop or beagle board or so? I'll try to reproduce that in a snappy VM.

Anyway, I'm off to holidays for the next 1.5 weeks, so I'm setting that to NEW for now. Thank you so far!

Changed in systemd (Ubuntu):
status: Incomplete → New
Revision history for this message
Victor Mayoral (vmayoral) wrote :

@Martin,

Everything i shared was done in the BeagleBone Black latest image.
Cheers,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.