You are not logged in.

#1 2012-12-05 17:26:46

mDuo13
Member
Registered: 2010-04-25
Posts: 89

[Solved] Samba stopped working after systemd

I rarely use my samba shares, but occasionally I need them as a way to share data with a Windows XP guest in VirtualBox. They seem to have stopped working ever since I switched to systemd. Before I upgraded to systemd, I had to manually (re-)start samba after booting up to make the shares available. After upgrading to systemd, even restarting the smbd and nmbd daemons doesn't fix it.

I dug around the forums and found some people with similar issues, but none of them quite describe where I'm at and none of the answers worked for me. And of course I tried the obvious superstitious stuff like "do a full system upgrade with pacman" and "reboot".

The logs don't show much for smbd; as for nmbd, I'm not really sure what to make of the following:

Dec 01 09:00:26 localhost nmbd[1281]: *****
Dec 01 09:00:26 localhost nmbd[1281]: 
Dec 01 09:00:26 localhost nmbd[1281]: Samba name server LOCALHOST is now a local master browser for workgroup WORKGROUP on subnet 10.1.10.13
Dec 01 09:00:26 localhost nmbd[1281]: 
Dec 01 09:00:26 localhost nmbd[1281]: *****
Dec 01 09:04:21 localhost nmbd[1281]: [2012/12/01 09:04:21.546253,  0] nmbd/nmbd_incomingdgrams.c:311(process_local_master_announce)
Dec 01 09:04:21 localhost nmbd[1281]: process_local_master_announce: Server RAPTER at IP 10.1.10.21 is announcing itself as a local master bro
Dec 01 09:04:21 localhost nmbd[1281]: [2012/12/01 09:04:21.546457,  0] nmbd/nmbd_become_lmb.c:150(unbecome_local_master_success)
Dec 01 09:04:21 localhost nmbd[1281]: *****
Dec 01 09:04:21 localhost nmbd[1281]: 
Dec 01 09:04:21 localhost nmbd[1281]: Samba name server LOCALHOST has stopped being a local master browser for workgroup WORKGROUP on subnet 1
Dec 01 09:04:21 localhost nmbd[1281]: 
Dec 01 09:04:21 localhost nmbd[1281]: *****
Dec 01 09:04:36 localhost nmbd[1281]: [2012/12/01 09:04:36.370493,  0] nmbd/nmbd_become_lmb.c:418(become_local_master_fail2)
Dec 01 09:04:36 localhost nmbd[1281]: become_local_master_fail2: failed to register name WORKGROUP<1d> on subnet 10.1.10.13. Failed to become 
Dec 01 09:04:36 localhost nmbd[1281]: [2012/12/01 09:04:36.370652,  0] nmbd/nmbd_namelistdb.c:309(standard_fail_register)
Dec 01 09:04:36 localhost nmbd[1281]: standard_fail_register: Failed to register/refresh name WORKGROUP<1d> on subnet 10.1.10.13
Dec 02 03:15:01 localhost nmbd[1281]: [2012/12/02 03:15:01.182243,  0] nmbd/nmbd.c:128(nmbd_sig_hup_handler)
Dec 02 03:15:01 localhost nmbd[1281]: Got SIGHUP dumping debug info.
Dec 02 03:15:01 localhost nmbd[1281]: [2012/12/02 03:15:01.182384,  0] nmbd/nmbd_workgroupdb.c:276(dump_workgroups)
Dec 02 03:15:01 localhost nmbd[1281]: dump_workgroups()
Dec 02 03:15:01 localhost nmbd[1281]: dump workgroup on subnet      10.1.10.13: netmask=  255.255.255.0:
Dec 02 03:15:01 localhost nmbd[1281]: WORKGROUP(1) current master browser = LEN
Dec 02 03:15:01 localhost nmbd[1281]: LOCALHOST 40819a03 (Samba Server)
Dec 02 03:15:01 localhost nmbd[1281]: LEN 40051003 ()

One other thing that is suspicious is that it seems to start two copies of smbd whenever I start the service, although both copies get stopped when I stop or restart it:

[mduo13@localhost ~]$ ps ax | grep mbd
 1281 ?        Ss     0:09 /usr/sbin/nmbd -F
 6372 pts/0    S+     0:00 grep mbd
22765 ?        Ss     0:00 /usr/sbin/smbd -F
22784 ?        S      0:00 /usr/sbin/smbd -F
[mduo13@localhost ~]$ sudo systemctl stop smbd.service
[mduo13@localhost ~]$ ps ax | grep mbd
 1281 ?        Ss     0:09 /usr/sbin/nmbd -F
 6955 pts/0    S+     0:00 grep mbd
[mduo13@localhost ~]$ sudo systemctl start smbd.service
[mduo13@localhost ~]$ ps ax | grep mbd
 1281 ?        Ss     0:09 /usr/sbin/nmbd -F
 7792 ?        Ss     0:00 /usr/sbin/smbd -F
 7794 ?        S      0:00 /usr/sbin/smbd -F
 7836 pts/0    S+     0:00 grep mbd

Any ideas? Am I doing something braindead here? Is my PC haunted? I'd love to know.

Last edited by mDuo13 (2012-12-05 21:37:47)

Offline

#2 2012-12-05 21:31:34

mDuo13
Member
Registered: 2010-04-25
Posts: 89

Re: [Solved] Samba stopped working after systemd

Solved it -- after giving up and moving on to something else, I figured it out.

My hostname was not set -- thus the terminal showing @localhost instead of the hostname I normally use.

I set the hostname as described in the wiki page for systemd:

$ sudo hostnamectl set-hostname myhostname

Then logged out and back in again and finally restarted smbd and nmbd:

sudo systemctl restart smbd.service nmbd.service

Presto! Samba works again.

I'll be editing the wiki page for migrating from systemd to include mention of changing your hostname even if you're migrating from an existing system.

Offline

Board footer

Powered by FluxBB