[Samba] Samba File Locking Problem
Cameron B. Prince
cprince at rideware.com
Thu Mar 25 16:35:32 GMT 2004
I have a situation in the office where I temporarily need to provide
additional clients access to a share on a Windows 2000 Professional box.
2000 Pro seems to only allow 5 clients to connect to a share and there is no
faclity to allow more as best I can tell. Upgrading isn't really an option
and as I said, this is a temporary need.
I have a linux box as a gateway so I decided to map the share from the
windows box to it via smbmount, then reshare that mount via samba. Then I
could point the extra clients to the linux box which would effectively be
transparently be connecting them to the windows box.
It works and works well, but I have hit one snag.
Each client runs a program that creates files on the share. A program is
running on the windows box that scans this directory and moves the files to
another directory for processing. When clients connected directly to the
windows share create the files, they are moved and everything works as
intended. When clients connect to the windows share via linux create the
files, the program on the windows box crashes.
I found that this is caused by the client maintaining a lock on the file
after it's created. If I stop the program on the windows box, make the
client create the file, shutdown the client, then start the program on the
windows box, everything is fine.
I've also confirmed I can't move or rename the files manually until the
client that created them is shutdown.
What can I do to keep this lock from being maintained?
Here's the line from fstab that mounts the share on the linux box:
//doveserver/c /mnt/samba smbfs
uid=500,gid=500,username=user1,password=user1,rw 0 0
User 500 is florist.
Here's permissions on /mnt/samba:
drwxr-xr-x 1 florist florist 4096 Mar 18 15:32 samba
Here's the share definition from smb.conf:
comment = C On Doveserver
path = /mnt/samba
public = yes
writable = yes
create mask = 0775
inherit permissions = yes
Any help or ideas would certainly be appreciated.
More information about the samba