On Sunday 07 March 2021, Cristian Rodríguez wrote:
On Sat, Mar 6, 2021 at 5:32 AM Michael Hamilton
This might not be the right place to raise this -
it might be better
sent to a samba user list, but...
On tumbleweed I've noticed that nmbd consistently delays booting
to the login prompt by several seconds. Systemd-analyse blame and
systemd-analyse critical chain report numbers such as:
The critical chain to graphical target is reported as 11.344s. If I
disable smbd and nmbd this drops to 7.360s.
Looking at its source code, nmbd appears to sleep(5) in three places
while waiting for interfaces to become available:
find ./samba/source3/nmbd -type f | xargs grep sleep
Huh ? it *sleeps* waiting for what network interfaces to come up? doesn't
poll or otherwise ask netlink for the network status? that's.. broken..
try ordering nmb after network-online.target and enable the relevant
I guess the code may have a long heritage and might also be
written to be portable to more than just modern Linux. I remember
compiling samba for SGI boxes last century, so there's probably
some pretty old code in there. By modern standards a hard coded
sleep(5) does seem somewhat execessive.
After experimentally changing the sleep()s to tiny usleep()s and
rebuilding from srpm, I found this makes no difference. I used
usleep() so I could use nm to check if the change made into the
binary. So either nmbd is waiting legitimately or something else is
causing the delay - maybe some sub-component, or maybe the
browse master election (I tried rigging the election, but that did
Thanks for the suggestions on reording startup dependencies. I'm
hesitant to overly customise my boot sequence. I will keep this option
in mind because I feel I should one day figure out more of how systemd
I've now spent roughly many thousands of boots worth of potential
savings, I think I will call a halt to my own fiddling. I may ask about
speeding up nmbd initialisation on the samba lists just to see if there's
a simple answer.