[Pkg-samba-maint] Bug#842056: nmbd hangs on service start if only the loopback interface is configured

Robie Basak robie.basak at ubuntu.com
Tue Oct 25 15:42:14 UTC 2016


Package: samba
Version: 2:4.4.6+dfsg-2
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu zesty

nmbd fails to start if no interfaces are configured, even if the
loopback interface _is_ configured. Steps to reproduce:

apt-get update && apt-get -y install samba
systemctl stop nmbd
ifdown eth0
systemctl start nmbd

This fails as follows:

Job for nmbd.service failed because a timeout was exceeded.
See "systemctl status nmbd.service" and "journalctl -xe" for details.

# systemctl status nmbd.service
● nmbd.service - Samba NMB Daemon
   Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
   Active: failed (Result: timeout) since Tue 2016-10-25 15:25:50 UTC; 8min ago
     Docs: man:nmbd(8)
           man:samba(7)
           man:smb.conf(5)
 Main PID: 2241
   Status: "nmbd: No local IPv4 non-loopback interfaces available, waiting for interface ..."
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/nmbd.service

Oct 25 15:24:20 rbasak-sid systemd[1]: Starting Samba NMB Daemon...
Oct 25 15:24:20 rbasak-sid systemd[1]: nmbd.service: Supervising process 2241 which is not our ch
ild. We'll most likely not notice when it exits.
Oct 25 15:25:50 rbasak-sid systemd[1]: nmbd.service: Start operation timed out. Terminating.
Oct 25 15:25:50 rbasak-sid systemd[1]: nmbd.service: Killing process 2241 (nmbd) with signal SIGK
ILL.
Oct 25 15:25:50 rbasak-sid systemd[1]: Failed to start Samba NMB Daemon.
Oct 25 15:25:50 rbasak-sid systemd[1]: nmbd.service: Unit entered failed state.
Oct 25 15:25:50 rbasak-sid systemd[1]: nmbd.service: Failed with result 'timeout'.

Note the message from nmbd: "No local IPv4 non-loopback interfaces
available, waiting for interface".

I think this is a bug because laptop users may have samba installed but
don't always have a network available (apart from loopback).

I found bug 698056 which seems related, but crucially it seems that
report is considered invalid because the loopback interface is not
configured, which sounds like a system misconfiguration. In contrast, in
this case the loopback interface *is* configured but nmbd still fails to
start.

Bug 840608 may also be related, but I'm not sure since the reporter
didn't have independent steps to reproduce.

This bug was originally reported in Ubuntu in
https://launchpad.net/bugs/1635491. In triaging that bug, I found that I
could reproduce the issue in both Ubuntu and on Debian sid, so I am
forwarding the report with more details here.

Speculation: since nmbd.service says "Type=notify", is this a bug or
unexpected behaviour in nmbd that it does not notify before waiting for
a non-loopback interface to appear? It seems to me that it would be more
useful for nmbd to consider itself running before bind if there is
nothing to bind on and it will bind when interfaces appear.
Alternatively, perhaps the systemd job should arrange for nmbd to be
started when interfaces arrive, and to stop nmbd when there are none
available?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20161025/9897b46d/attachment.sig>


More information about the Pkg-samba-maint mailing list