I have a small Samba just for file sharing on a ARM device (SheevaPlug). Until now everything was fine, however I decided to upgrade to Debian 8.1 and by some reason the shares aren't working properly.

Whenever the device boots I'm unable to access the Samba shares, they're are advertised and all but I'm unable to connect, my OS says the server is unavailable.

However, if I restart Samba manually over SSH on the device using:

service smbd restart

The shares start to work again. So I decided to investigate log files and got this:


[2015/08/08 22:45:54.596532,  0] ../lib/util/become_daemon.c:147(daemon_status)
  STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for interface ...NOTE: NetBIOS name resolution is not supported for Internet Protocol Version 6 (IPv6).
[2015/08/08 22:45:59.599920,  0] ../lib/util/become_daemon.c:136(daemon_ready)
  STATUS=daemon 'nmbd' finished starting up and ready to serve connections*****


2015/08/08 22:45:57.881551,  0] ../lib/util/become_daemon.c:136(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connectionsopen_sockets_smbd: No sockets available to bind to.
[2015/08/08 22:45:57.913376,  0] ../source3/lib/util.c:785(smb_panic_s3)
  PANIC (pid 996): open_sockets_smbd() failed
[2015/08/08 22:45:57.923081,  0] ../source3/lib/util.c:896(log_stack_trace)

I guess Samba is starting before the network is ready and working, am I right? If yes how can I fix this and make sure the network is actually available before starting Samba?

This is my current Samba configuration:

        workgroup = WORKGROUP
        netbios name = Super-Share
        server string = Super-Share

        security = USER
        invalid users = root  
        encrypt passwords = true
        lanman auth = No    

        hosts allow =
        hosts deny =

        interfaces = eth0
        bind interfaces only = yes

        browseable = Yes
        max protocol = smb2

        socket options = TCP_NODELAY IPTOS_LOWDELAY
        read raw = No
        write raw = No
        use sendfile = Yes
        refresh = 1
        max xmit = 131072

        aio write behind = true 
        aio read size = 16384 
        aio write size = 16384 

        name resolve order = wins hosts lmhosts bcast             
        dns proxy = No              
        load printers = No
        printing = bsd
        printcap name = /dev/null
        disable spoolss = yes

        path = /mnt/SU1/SU1/
        read only = No
        guest ok = No
        writable = yes
        force user = root
        force group = root
        create mask = 0777
        directory mask = 0777



As I expected this is a network issue. If I add:

post-up /etc/init.d/smbd restart

At my /etc/network/interfaces it works fine, however it's dirty, I can I properly fix this?

  • @lain You know this could happen on small company.
    – TCB13
    Aug 8 '15 at 22:04
  • It's a SheevaPlug with a clean OS. Pi wasn't enough to handle things over here. We're 4 users, 2 use this for work related stuff.
    – TCB13
    Aug 8 '15 at 22:55

You can probably set bind interfaces only = no, so Samba will be reacting to changes in interfaces list. This shouldn't affect security.

It wouldn't also hurt to include lo within interfaces line.

  • Wouldn't this allow it to listen on all network interfaces?
    – TCB13
    Aug 9 '15 at 13:18
  • It only changes the way Samba enforces the list. The list itself is specified with interfaces stanza. You can also use iptables as another layer of filtering. Aug 9 '15 at 13:23
  • Here is the problem, this network issue where applications try to start and bind before the network is some new crap related to systemd on Debian 8.1, I have the exact same problem with lighttpd. The solution you're saying it's like adding a post-up it works but it's not the right way... thanks.
    – TCB13
    Aug 9 '15 at 13:24
  • But what this systemd-related problem is really about? It's a bit confusing. AFAIR bind interfaces only = false is the default in Samba and using it should not interfere with init process in any way. Read the Samba manual what this option realy does. Aug 9 '15 at 13:39
  • Samba tries to start before network is ready and then it can bind to the interfaces... Before systemd it looks like Samba was only started after the network was ready and everything worked fine. Right now it tries to start before causing issues to bind to the interfaces that aren't yet there...
    – TCB13
    Aug 9 '15 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.