FS#31192 - systemd: nmbd fails to start if samba was setup to bind to a specific interface

Attached to Project: Arch Linux
Opened by Milos Kaurin (Kaurin) - Sunday, 19 August 2012, 11:29 GMT
Last edited by Tobias Powalowski (tpowa) - Wednesday, 29 August 2012, 07:39 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Tobias Powalowski (tpowa)
Tom Gundersen (tomegun)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
NetworkManager.service starts after nmbd.service. This makes nmbd fail because it's unable to bind to an interface that is not up yet.


Additional info:


Steps to reproduce:

edit /etc/samba/smb.conf
# set interfaces to one of the ips you wish to bind samba to
# example:
interfaces 127.0.0.1 192.168.1.2
# 192.168.1.2 being one of the IPs on your box

reboot

This is the result:

# systemctl status nmbd.service
nmbd.service - Samba NetBIOS name server
Loaded: loaded (/usr/lib/systemd/system/nmbd.service; enabled)
Active: failed (Result: exit-code) since Sun, 19 Aug 2012 14:35:07 +0200; 1min 8s ago
Process: 324 ExecStart=/usr/sbin/nmbd -F (code=exited, status=1/FAILURE)
CGroup: name=systemd:/system/nmbd.service


# systemctl status winbindd.service
winbindd.service - Samba Winbind daemon
Loaded: loaded (/usr/lib/systemd/system/winbindd.service; enabled)
Active: active (running) since Sun, 19 Aug 2012 14:35:02 +0200; 2min 52s ago
Main PID: 331 (winbindd)
CGroup: name=systemd:/system/winbindd.service
├ 331 /usr/sbin/winbindd -F
└ 366 /usr/sbin/winbindd -F


# systemctl status smbd.service
smbd.service - Samba SMB/CIFS server
Loaded: loaded (/usr/lib/systemd/system/smbd.service; enabled)
Active: active (running) since Sun, 19 Aug 2012 14:35:02 +0200; 3min 15s ago
Main PID: 330 (smbd)
CGroup: name=systemd:/system/smbd.service
├ 330 /usr/sbin/smbd -F
└ 365 /usr/sbin/smbd -F


# cat /var/log/everything.log | grep -i nmbd
Aug 12 20:25:20 localhost nmbd[962]: [2012/08/12 20:25:20.022259, 0] nmbd/nmbd.c:66(terminate)
Aug 12 20:25:20 localhost nmbd[962]: Got SIGTERM: going down...


# cat /var/log/samba/log.nmbd
[2012/08/19 14:35:05, 0] nmbd/nmbd.c:861(main)
nmbd version 3.6.7 started.
Copyright Andrew Tridgell and the Samba Team 1992-2011
[2012/08/19 14:35:06, 0] nmbd/nmbd.c:889(main)
standard input is not a socket, assuming -D option
[2012/08/19 14:35:06, 0] lib/util_sock.c:667(open_socket_in)
bind failed on port 137 socket_addr = 192.168.1.2.
Error = Cannot assign requested address
[2012/08/19 14:35:06, 0] nmbd/nmbd_subnetdb.c:113(make_subnet)
nmbd_subnetdb:make_subnet()
Failed to open nmb socket on interface 192.168.1.2 for port 137. Error was Cannot assign requested address
[2012/08/19 14:35:06, 0] nmbd/nmbd.c:975(main)
ERROR: Failed when creating subnet lists. Exiting.


Solution:

Add After=network.target in nmbd.service file
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Wednesday, 29 August 2012, 07:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  3.6.7-2
Comment by Milos Kaurin (Kaurin) - Sunday, 19 August 2012, 11:38 GMT
Also, in smb.conf, the following option might needs to be set in order to reproduce the problem
bind interfaces only = yes

Loading...