Ok, I did some testing. I setup a zesty vm, installed samba (smbd and
nmbd) on it, then configured it to not bring up the network at boot time
(/etc/network/interfaces <- remove "auto eth0"). I can then login at the
console and bring eth0 up or down with "ifup" and "ifdown" commands at
will.

Here is what I observed:

- the boot never hangs
- systemd will give up on the nmbd job after 1min30s. Note that this wait 
happens in the background and doesn't block other jobs (unless they depend on 
nmbd, which isn't the case). If I login at the console (still no network) and 
run "systemd-analyze blame" before that timeout, it will say the system is 
still booting.
- nmbd actually starts as usual, detects there is no network, and wait for the 
network *forever*: there is no timeout. Its loop is essentially this:
    while (iface_count_v4_nl() == 0) {
        sleep(5);
        load_interfaces();
    }
- that's when it logs the message "No local IPv4 non-loopback interfaces 
available, waiting for interface...". It really waits forever.
- in that loop you will notice that it performs a check every 5s. That's why 
you see the "10s extra delay" every time with such precision: you probably 
logged between 5-10s after nmbd was started.
- if I run systemd-analyze blame after the 1min30s timeout, i.e., after systemd 
is "happy" that the system booted because it gave up on the nmbd job, then it 
will output nmbd.service at the very top with 1m30s, as expected.

To summarize, I believe what's happening is correct and normal for a
machine which only connects to the network after the user logs in. It's
not blocking your boot, nor delaying your login for an extra 10s: that
wait happens in the background, in parallel with all the rest that's
running. And as soon as the network is available, nmbd will detect that
in one if its 5s interval checks, and exit the loop and do its job.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to samba in Ubuntu.
https://bugs.launchpad.net/bugs/1706990

Title:
  With samba installed on Kubuntu 17.04, nmbd.service causes a 10 second
  boot time regression

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to