STATUS=daemon 'nmbd' : No local IPv4 non-loopback interfaces available, waiting for [SOLVED]

Hey folks,

run into a problem using samba server:

journalctl -xe -u smb


smbd[2354]: [2018/07/14 09:40:10.435746,  0] ../lib/util/become_daemon.c:124(daemon_ready)
smbd[2354]:   STATUS=daemon 'smbd' finished starting up and ready to serve connections
systemd[1]: Failed to start Samba SMB Daemon.

journalctl -xe -u nmb


nmbd[1836]: [2018/07/14 13:46:39.919899,  0] ../lib/util/become_daemon.c:135(daemon_status)
nmbd[1836]:   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).
nmbd[1836]: [2018/07/14 13:46:44.921926,  0] ../lib/util/become_daemon.c:124(daemon_ready)
nmbd[1836]:   STATUS=daemon 'nmbd' finished starting up and ready to serve connections
nmbd[1836]: [2018/07/14 13:46:44.922205,  0] ../source3/nmbd/nmbd.c:58(terminate)
nmbd[1836]:   Got SIGTERM: going down...
systemd[1]: Failed to start Samba NMB Daemon.
-- Subject: Unit nmb.service has failed

look for service file folder

systemctl status nmb.service


nmb.service - Samba NMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)

**cat /usr/lib/systemd/system/nmb.service
**


[Unit]
Description=Samba NMB Daemon
After=network.target

This means nmb.service is not waiting long enough for *network.target *to start up…

so search for a service which is starting AFTER network.target:

systemd-analyze critical-chain


The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @16.273s
└─multi-user.target @16.273s
    └─clamd.service @3.303s +12.663s
      └─freshclam.service @3.255s +47ms
        └─network.target @3.251s
          └─NetworkManager.service @3.142s +108ms
            └─network-pre.target @3.140s
              └─firewalld.service @2.498s +641ms
                └─dbus.service @2.407s
                  └─basic.target @2.404s
                    └─sockets.target @2.404s
                      └─avahi-daemon.socket @2.404s
                        └─sysinit.target @2.398s
                          └─apparmor.service @1.792s +605ms
                            └─var.mount @1.771s +13ms
                              └─systemd-fsck@dev-disk-by\x2dlabel-varlvm.service @1.740s +28ms
                                └─dev-disk-by\x2dlabel-varlvm.device @1.739s

changed AFTER

**vi /usr/lib/systemd/system/nmb.service
**


[Unit]
Description=Samba NMB Daemon
#After=network.target
After=clamd.service

[Service]
Type=notify
NotifyAccess=all
Environment=KRB5CCNAME=/run/samba/krb5cc_samba
EnvironmentFile=-/etc/sysconfig/samba
ExecStart=/usr/sbin/nmbd $NMBDOPTIONS
ExecReload=/usr/bin/kill -HUP $MAINPID

[Install]
WantedBy=multi-user.target


reboot

**systemctl status nmb.service smb.service -l
**


● nmb.service - Samba NMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-07-14 14:08:08 CEST; 24min ago
 Main PID: 2578 (nmbd)
   Status: "nmbd: ready to serve connections..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/nmb.service
           └─2578 /usr/sbin/nmbd -D

systemd[1]: nmb.service: Supervising process 2578 which is not our child. We'll most likely not notice when it exits.
systemd[1]: Started Samba NMB Daemon.
nmbd[2578]: [2018/07/14 14:08:08.905937,  0] ../lib/util/become_daemon.c:124(daemon_ready)
nmbd[2578]:   STATUS=daemon 'nmbd' finished starting up and ready to serve connections
nmbd[2578]: [2018/07/14 14:08:31.096171,  0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
nmbd[2578]:   *****
nmbd[2578]:   
nmbd[2578]:   Samba name server YOURLOCALHOSTNAME is now a local master browser for workgroup YOURWORKGROUP.NAME on subnet YOUR.SUB.NET.IP
nmbd[2578]:   
nmbd[2578]:   *****

● smb.service - Samba SMB Daemon
   Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-07-14 14:08:09 CEST; 24min ago
  Process: 2580 ExecStartPre=/usr/share/samba/update-apparmor-samba-profile (code=exited, status=0/SUCCESS)
 Main PID: 2585 (smbd)
   Status: "smbd: ready to serve connections..."
    Tasks: 4 (limit: 4915)
   CGroup: /system.slice/smb.service
           ├─2585 /usr/sbin/smbd -D
           ├─2587 /usr/sbin/smbd -D
           ├─2588 /usr/sbin/smbd -D
           └─2591 /usr/sbin/smbd -D
systemd[1]: Starting Samba SMB Daemon...
systemd[1]: smb.service: Supervising process 2585 which is not our child. We'll most likely not notice when it exits.
systemd[1]: Started Samba SMB Daemon.
smbd[2585]: [2018/07/14 14:08:09.094088,  0] ../lib/util/become_daemon.c:124(daemon_ready)
smbd[2585]:   STATUS=daemon 'smbd' finished starting up and ready to serve connections

both are running now.

I know that triggering with clamd.service is not the best solution.

If you have a better idea of a service to trigger with then please write down your suggestions.

I have already tried to trigger with multi-user.target only nmb.service is started but smb.service is started to late, so it will be terminated.

Source:

https://www.digitalocean.com/community/tutorials/how-to-use-journalctl-to-view-and-manipulate-systemd-logshttps://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840608

I’d be curious why network.target wasn’t sufficient…
Maybe “After” isn’t a strong enough dependency, perhaps something like “Requires” would make it work.

Recommend you submit a but to https://bugzilla.opensuse.org so that a Maintainer can look at it and perhaps implement a “better” solution (although “better” might not be any improvement if you have it working).

TSU

This has been marked as solved too soon IMO.
The default smb.service and nmb.service have been fixed in upstream, making both smb and nmb start after network-online.target.
That, however, according to the FreeDesktop documentation, requires the presence of a wait-online service, be it systemd-networkd, or, in the case of a Tumbleweed installation I just performed, NetworkManager-wait-online.service.

Adding network-online.target to both Wants and After on both smb.service and nmb.service and enabling NetworkManager-wait-online.service was enough to get my laptop to boot without having to wait 90s for nmb to time out, thus truly solving the issue.

Experienced same behaviour, hopefully I have no windows computers in my small lab network, so I put in the “name resolve order” lmhosts at the end… and nmb starts each time the server is booted.

I have wins bcast and lmhosts at this line.

I learnt new tools to tune up the system I never used systemd-analyze program… thank you !!