[Bug 1706990] Re: With samba installed on Kubuntu 17.04, nmbd.service causes a 10 second boot time regression

Andreas Hasenack andreas at canonical.com
Wed Aug 30 20:54:01 UTC 2017


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
Foundations Bugs, 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

Status in samba package in Ubuntu:
  Incomplete

Bug description:
  I'm running Kubuntu 17.04. After installing Samba rsion 2:4.5.8+dfsg-
  0ubuntu0.17.04.4), my boot time has regressed from about 12 seconds to
  23 seconds. `systemd-blame` shows that the culprit is the nmbd
  service:

  $ systemd-analyze blame | head -n 5
           10.017s nmbd.service
            8.008s apt-daily.service
            3.010s iio-sensor-proxy.service
             561ms dev-nvme0n1p2.device
             554ms NetworkManager-wait-online.service


  The nmbd systemd logs show that the 10 seconds is spent looking for a
  non-child nmb process:

  $ systemctl status nmbd.service | tail -n 3
  Jul 26 19:49:24 Spectre systemd[1]: Starting Samba NMB Daemon...
  Jul 26 19:49:24 Spectre systemd[1]: nmbd.service: Supervising process 1091 which is not our child. We'll most likely not notice when it exits.
  Jul 26 19:49:34 Spectre systemd[1]: Started Samba NMB Daemon.

  
  If I uninstall samba, the problem disappears.

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



More information about the foundations-bugs mailing list