View previous topic :: View next topic |
Author |
Message |
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Wed Jul 22, 2009 11:28 am Post subject: Samba file locking problems |
|
|
Hello all.
I have SMS 1.4.2 installed as a file server only.
I have problems with files already closed but wich samba keep blocked for editing allowing only read-only mode to open them.
my smb.conf is:
[global]
map to guest = Bad User
restrict anonymous = no
guest ok = yes
domain master = no
preferred master = no
workgroup = mywkg
server string = myserver
netbios name = myserver
max protocol = NT1
acl compatibility = winnt
ldap ssl = No
server signing = Auto
smb ports = 139
printcap name = /etc/printcap
#oplocks = no
log level = 0 locking:2
max log size = 500
bind interfaces only = yes
interfaces = 127.0.0.1 192.168.0.3
#reset on zero vc = yes
[myshare]
read only = no
path = /mnt/sda1/myshare
force directory mode = 0777
force create mode = 0777
I've tried several solutions found googling but none worked.
I use smbstatus -L and also lsof to see which file is locked and than kill -9 it's PID, but this is not a permanent solution.
Mabe a hint I cannot understand is why smbd opens files also as root and also as nobody, as lsof reports:
lsof | grep documents
smbd 17850 root 29ww REG 8,1 90624 2638603 /mnt/sda1/documents/_OFERTA 2006/JV-127 2006 .xls
smbd 17999 nobody 27r REG 8,1 735744 2941365 /mnt/sda1/documents/MARKETING/MONTAJE.xls
I have to mention that all the files in the share belong to nobody.nogroup and have mask 0777.
Any ideas please?
Thanks in advance. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed Jul 22, 2009 12:36 pm Post subject: |
|
|
If you don't need authentication and accessing files without password just add
security =share
and remove
map to guest = Bad User
here is the default smb.conf that SMS uses.
Remember plainer the conf the better it is.
Code: | [global]
log file = /var/log/samba.%m
ldap ssl = No
restrict anonymous = no
domain master = no
public = yes
server string = SMS Samba Server
max protocol = NT1
workgroup = WORKGROUP
acl compatibility = winnt
server signing = Auto
security = share
preferred master = no
max log size = 50
[Samba @ SMS]
path = /var/smb/samba/
read only = no
[FAXES]
path = /var/spool/hylafax/recvq/
read only = no
[TorrentFlux Downloads]
path = /var/smb/tflux_downloads/
read only = no |
Backup your conf and replace it with default and do the necessary changes.
chmod 777 it's not necessarily as long as they owned by nobody:nogroup.
I don't see in your conf anywhere the
path=/mnt/sda1/documents/
unless the
/mnt/sda1/myshare it's a symlink to it, if so replaced it with
/mnt/sda1/documents/ in your conf.
Do a
'chmod -R 777 /mnt/sda1/documents/'
'chown -R nobody.nogroup /mnt/sda1/documents/'
What's the output of 'ls -l /mnt/sda1/documents/' regarding permissions.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Wed Jul 22, 2009 12:54 pm Post subject: |
|
|
Dear gerasimos_h,
Thanks for the fast answer. You are right.
I used the slax's conf since migrated to SMS and probably I was too in a hurry when I compared the directives.
I'll make the sugested corrections and come back in few days with results.
Don't bother with /mnt/sda1/documents/ and /mnt/sda1/myshare because I tryed to be more general using "/myshare", the real code is with "/documents" and the permissions are 0777.
Thanks again, I'll be right back soon, to tell if keeping locked closed files
is no more a problem. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed Jul 22, 2009 1:01 pm Post subject: |
|
|
Don't forget that the permissions are only for samba if you are copying files locally through 'cp' command or kde, the files will get the permissions of your user.
That applies too if you are sharing the same folder via nfs or appletalk and you have set a different guest user.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Wed Jul 22, 2009 1:11 pm Post subject: |
|
|
OK, thanks.
I made the corrections, and stop/start rc.samba.
Everything looks working.
I get some error in log.smbd:
Code: | [2009/07/22 14:07:27, 0] smbd/negprot.c:reply_nt1(326)
reply_nt1: smb signing is incompatible with share level security ! |
I'll google for it.... |
|
Back to top |
|
keopp Senior Member
Joined: 08 Nov 2008 Posts: 166 Location: Romania
|
Posted: Wed Jul 22, 2009 1:54 pm Post subject: |
|
|
ok
I think I found the
<reply_nt1: smb signing is incompatible with share level security>
error issue.
It comes from: Quote: | server signing = Auto |
which seems to be incompatible with:
I'm still watching after the closed files locked problem to report here. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Wed Jul 22, 2009 3:34 pm Post subject: |
|
|
I know about the error - that's ok it's no issue just a warning since we using share level security - that's irrelevant with your issue.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
|