site  contact  subhomenews

Samba nmbd failed to start

November 15, 2021 — BarryK

I reported a fix for 'smbd' failing to start:

https://bkhome.org/news/202111/samba-daemon-startup-fixed.html

After releasing Easy 3.1.10, Alfons tested 'smbd' and that starts, however, 'nmbd' daemon fails to start.

Yeah, it has the same error, cannot create a directory in which to place the pid file. In this case, the log file does not identify what directory it is failing to create.

I was wondering why used to be OK, why is it now failing to create directories immediately underneath a directory that is a symlink. The Arch Linux guys have identified the problem introduced in samba 4.10.0 (Easy has 4.10.18):

https://bugs.archlinux.org/task/62262

...in their case, the pid directory is /var/run, where 'run' is a symlink to /run

In Easy however, /var/run is OK, as 'var' is a symlink, and 'run' is not. It would be nice if the samba devs fixed their code, but anyway, I have fixed the problem in Easy by inserting a line in /etc/samba/smb.conf:

[global]
workgroup = WORKGROUP
server string = Puppy Samba Server
security = user
map to guest = Bad Password
printing = cups
printcap name = cups
load printers = yes
pid directory = /var/run

[puppyshare]
path = /files
writable = yes

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = yes
writable = no
printable = yes

That did the trick, 'nmbd' started. The fix is in packages-templates/samba in woofQ.

EDIT:
Alfons has reported the above fix has worked for him. He has now got Samba talking with his phone, using wireguard. Quoting from his email, with photos:

Have now established a peer-to-peer connection with my smartphone from the internet to samba easyos-3.1.10 and this works perfectly via the secure connection from wireguard. This is already great!

img1

img2

If you want to know more details how Alfons got that setup, if I don't know the answer to your questions, I will have to pass on your questions via email, as he is not registered on the forum. Well, there is a thread where wireguard can be discussed:

https://forum.puppylinux.com/viewtopic.php?t=4404 

EDIT 2021-11-16:
Not there yet! Alfons discovered that /usr/local/EasyShare/samba-setup is overwriting /etc/samba/smb.conf, without that "pid address" line. So, the 'samba-setup' script needs to have it inserted, at line 124:

	echo "#this is a very simple smb.conf to get you started
#coutesy rcrsn51 and gcmartin
[global]
workgroup = $WGROUP
$NETBIOSNAME
server string = EasyShare Samba Configuration
security = user
map to guest = Bad Password
printing = cups
printcap name = cups
load printers = yes
unix extensions = yes
pid directory = /var/run

[$SHARENAME]
path = $MYPATH
writable = yes
" > /tmp/smb.conf

[ $MYPATH2 ]&& echo "
[$SHARENAME2]
path = $MYPATH2
writable = yes
" >> /tmp/smb.conf

[ $MYPATH3 ]&& echo "
[$SHARENAME3]
path = $MYPATH3
writable = yes
" >> /tmp/smb.conf

echo "
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = yes
writable = no
printable = yes
" >> /tmp/smb.conf

...interesting, the original smb.conf does not have that "unix extensions = yes" line.        

Tags: easy