I'd like to figure out what is taking nmbd so long to start up and fix it.

So how can I speed up the startup time of nmbd? Those pesky five seconds look a bit like they could be some timeout of sorts. And since smbd depends on nmbd this slowdown affects startup of the Samba server.

No matter what I do, it always appears to take almost exactly five seconds to start up, but most importantly by default nmbd and smbd are in the systemd-analyze critical-chain output right before reaching multi-user.target.

# systemd-analyze blame|grep -P '^\d'
5.963s fwupd.service
5.062s bolt.service
5.043s nmbd.service
1.088s dev-nvme0n1p2.device
1.045s upower.service

# systemctl status nmbd.service 
● nmbd.service - Samba NMB Daemon
     Loaded: loaded (/lib/systemd/system/nmbd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-06-29 22:32:28 CEST; 6min ago
       Docs: man:nmbd(8)
   Main PID: 1645 (nmbd)
     Status: "nmbd: ready to serve connections..."
      Tasks: 1 (limit: 76702)
     Memory: 12.7M
     CGroup: /system.slice/nmbd.service
             └─1645 /usr/sbin/nmbd --foreground --no-process-group

Jun 29 22:32:23 sysname systemd[1]: Starting Samba NMB Daemon...
Jun 29 22:32:28 sysname systemd[1]: Started Samba NMB Daemon.

This was after I had overridden both the nmbd.service and smbd.service units as follows:



... which resulted in this (systemd-analyze plot output):

Queuing nmbd after multi-user.target

... as opposed to this (systemd-analyze plot output) before:

Preset for nmbd, queued before multi-user.target

Both boots took twelve seconds plus some.

Your Answer

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

Browse other questions tagged or ask your own question.