Stop job for NMB Daemon delay at shutdown/reboot, but not always

While messing around with console and framebuffer resolutions, I rebooted and shut down/turned on my media server box a number of times.
About half the times I got a countdown with the console message:

**     ] A stop job is running for Samba NMB Daemon (XXs / 1min 30s)

The other half shut down without delay.

The other times this happened, infrequently, I thought it was due to my daughter’s laptop being connected, or a couple media clients (RPi on nfs, WDTV Live on SMB), but today both media boxes were off and the laptop was suspended (after having accessed the media server), and still I got the half-the-times delays.

The only other thing that could be accessing the server is a samba client in my android phone called AndSMB, but it was not running.

So, my questions are:

  1. What could be causing it?

  2. Is there a way to change the delay ime - say, from 1m 30s to 30s?

Thanks

This can be done globally via /etc/systemd/system.conf by uncommenting and setting the ‘DefaultTimeoutStopSec’ option with an acceptable value. Refer ‘man systemd-system.conf’ for more info.

Alternatively, it can be added to a particular unit file (refer ‘man systemd.service’)…

TimeoutStopSec=Configures the time to wait for stop. If a service is asked to stop, but does not terminate in the specified time, it will be terminated forcibly via SIGTERM, and after another timeout of equal duration with SIGKILL (see KillMode= in systemd.kill(5)). Takes a unit-less value in seconds, or a time span value such as “5min 20s”. Pass “infinity” to disable the timeout logic. Defaults to DefaultTimeoutStopSec= from the manager configuration file (see systemd-system.conf(5)).

For the latter option, it would be best to create a custom unit in /etc/systemd/system/ with the desired configuration to override the existing /usr/lib/systemd/system/nmb.service.

Thank you, Deano. I’ve changed the default timeout.

I hit this NMB issue during booting and, the solution possibly also affects the shutdown – it’s possibly due to an IPv6 issue – especially since my ISP changed to “IPv6 only” (with an IPv4 tunnel … ):
In “/etc/sysconfig/network/”, ‘config’, there’s something which needs to be changed:


## Type:        string
## Default:     ""
#
# Allows to specify options to use when writting the /etc/resolv.conf,
# for example:
#       "debug attempts:1 timeout:10"
# See resolv.conf(5) manual page for details.
#
NETCONFIG_DNS_RESOLVER_OPTIONS="inet6 edns0 single-request single-request-reopen"

You also have to make sure that, in ‘smb.conf’ the interfaces are clearly defined: “interfaces = 127.0.0.1 192.168.178.0/24 eth0”.