Re: [Samba] File locks?
On Thu, Apr 10, 2008 at 10:12:54AM -0600, Jim Young wrote: Hello, Recently, the following problem started happening with a particular samba server: If i have a file open for reading (say, a pdf in xpdf) and then try to write to it (say, through recompiling a latex document) it complains that it cannot open the file for writing. this seems like a file lock issue but I am unsure where it is happening. My previous usage should be perfectly safe since xpdf should only open for reading. This problem does not happen locally or when I connect to a different samba server (a windows machine). I can also ssh into the remote server, port xpdf , and my local process can write to the file. It is the samba connection that is making the lock. I am running Debian Unstable, using smbclient/smbfs 3.0.28a-1 to connect to a samba server (unix backend) on my university network. Server: Samba3.0.10-1.4E I mount the smb share in my fstab as follows: //myserver/jyoung/mnt/unismbfs credentials=credsfile,gid=jyoung,uid=jyoung,auto,rw smbfs is going out of support soon. You should be using cifsfs instead. Jeremy. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks?
Thanks for the info. I am using the smbfs debian package, but mount tells me that type is cifs //nsh/jyoung on /mnt/uni type cifs (rw,mand) I have updated my fstab: //nsh/jyoung/mnt/unicifs credentials=/myfolder/credentials,gid=jyoung,uid=jyoung,auto,rw 0 0 and remounted, same problem. Thanks, Jim On 10/04/2008, Jeremy Allison [EMAIL PROTECTED] wrote: On Thu, Apr 10, 2008 at 10:12:54AM -0600, Jim Young wrote: Hello, Recently, the following problem started happening with a particular samba server: If i have a file open for reading (say, a pdf in xpdf) and then try to write to it (say, through recompiling a latex document) it complains that it cannot open the file for writing. this seems like a file lock issue but I am unsure where it is happening. My previous usage should be perfectly safe since xpdf should only open for reading. This problem does not happen locally or when I connect to a different samba server (a windows machine). I can also ssh into the remote server, port xpdf , and my local process can write to the file. It is the samba connection that is making the lock. I am running Debian Unstable, using smbclient/smbfs 3.0.28a-1 to connect to a samba server (unix backend) on my university network. Server: Samba3.0.10-1.4E I mount the smb share in my fstab as follows: //myserver/jyoung/mnt/unismbfs credentials=credsfile,gid=jyoung,uid=jyoung,auto,rw smbfs is going out of support soon. You should be using cifsfs instead. Jeremy. -- James Young, B.Sc. Ph.D. Student Interactions laboratory, Department of Computer Science, University of Calgary 2500 University Drive NW, Calgary, Alberta, Canada, T2N 1N4 Phone: +1.403.210.9502 E-mail: [EMAIL PROTECTED] URL: http://pages.cpsc.ucalgary.ca/~jyoung/ -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks?
Hallo, Jeremy, Du (jra) meintest am 10.04.08: smbfs is going out of support soon. You should be using cifsfs instead. Maybe cifs doesn't work with Windows9x Clients. Viele Gruesse! Helmut -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks?
Am Donnerstag, 10. April 2008 schrieb Jim Young: Hi Jim, Thanks for the info. I am using the smbfs debian package, but mount tells me that type is cifs //nsh/jyoung on /mnt/uni type cifs (rw,mand) I have updated my fstab: //nsh/jyoung/mnt/unicifs credentials=/myfolder/credentials,gid=jyoung,uid=jyoung,auto,rw 0 0 and remounted, same problem. Thanks, Jim On your local system. what's the outcome of 'modinfo cifs' ? Btw - recent debian/ubuntu packages ship versions of the smb/cifs userland helpers smbmount and smbumount, which are no longer mounting smbfs when specified. Instead they mount cifs vfs behind the scenes. Both are (usually) also called indirectly by the mount/umount programs. Technically spoken, 'mount -t smbfs ...' is (ususally) calling /sbin/mount.smbfs which formerly mounted smbfs - but now cifs vfs instead. Cheers, Günter On 10/04/2008, Jeremy Allison [EMAIL PROTECTED] wrote: On Thu, Apr 10, 2008 at 10:12:54AM -0600, Jim Young wrote: Hello, Recently, the following problem started happening with a particular samba server: If i have a file open for reading (say, a pdf in xpdf) and then try to write to it (say, through recompiling a latex document) it complains that it cannot open the file for writing. this seems like a file lock issue but I am unsure where it is happening. My previous usage should be perfectly safe since xpdf should only open for reading. This problem does not happen locally or when I connect to a different samba server (a windows machine). I can also ssh into the remote server, port xpdf , and my local process can write to the file. It is the samba connection that is making the lock. I am running Debian Unstable, using smbclient/smbfs 3.0.28a-1 to connect to a samba server (unix backend) on my university network. Server: Samba3.0.10-1.4E I mount the smb share in my fstab as follows: //myserver/jyoung/mnt/unismbfs credentials=credsfile,gid=jyoung,uid=jyoung,auto,rw smbfs is going out of support soon. You should be using cifsfs instead. Jeremy. -- James Young, B.Sc. Ph.D. Student Interactions laboratory, Department of Computer Science, University of Calgary 2500 University Drive NW, Calgary, Alberta, Canada, T2N 1N4 Phone: +1.403.210.9502 E-mail: [EMAIL PROTECTED] URL: http://pages.cpsc.ucalgary.ca/~jyoung/ -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks?
Thank you for the reply, # modinfo cifs filename: /lib/modules/2.6.24-1-686/kernel/fs/cifs/cifs.ko version:1.52 description:VFS to access servers complying with the SNIA CIFS Specification e.g. Samba and Windows license:GPL author: Steve French [EMAIL PROTECTED] srcversion: 6BE8BB9F68C542F4B1774D3 depends: vermagic: 2.6.24-1-686 SMP mod_unload 686 parm: CIFSMaxBufSize:Network buffer size (not including header). Default: 16384 Range: 8192 to 130048 (int) parm: cifs_min_rcv:Network buffers in pool. Default: 4 Range: 1 to 64 (int) parm: cifs_min_small:Small network buffers in pool. Default: 30 Range: 2 to 256 (int) parm: cifs_max_pending:Simultaneous requests to server. Default: 50 Range: 2 to 256 (int) On 10/04/2008, Guenter Kukkukk [EMAIL PROTECTED] wrote: Am Donnerstag, 10. April 2008 schrieb Jim Young: Hi Jim, Thanks for the info. I am using the smbfs debian package, but mount tells me that type is cifs //nsh/jyoung on /mnt/uni type cifs (rw,mand) I have updated my fstab: //nsh/jyoung/mnt/unicifs credentials=/myfolder/credentials,gid=jyoung,uid=jyoung,auto,rw 0 0 and remounted, same problem. Thanks, Jim On your local system. what's the outcome of 'modinfo cifs' ? Btw - recent debian/ubuntu packages ship versions of the smb/cifs userland helpers smbmount and smbumount, which are no longer mounting smbfs when specified. Instead they mount cifs vfs behind the scenes. Both are (usually) also called indirectly by the mount/umount programs. Technically spoken, 'mount -t smbfs ...' is (ususally) calling /sbin/mount.smbfs which formerly mounted smbfs - but now cifs vfs instead. Cheers, Günter On 10/04/2008, Jeremy Allison [EMAIL PROTECTED] wrote: On Thu, Apr 10, 2008 at 10:12:54AM -0600, Jim Young wrote: Hello, Recently, the following problem started happening with a particular samba server: If i have a file open for reading (say, a pdf in xpdf) and then try to write to it (say, through recompiling a latex document) it complains that it cannot open the file for writing. this seems like a file lock issue but I am unsure where it is happening. My previous usage should be perfectly safe since xpdf should only open for reading. This problem does not happen locally or when I connect to a different samba server (a windows machine). I can also ssh into the remote server, port xpdf , and my local process can write to the file. It is the samba connection that is making the lock. I am running Debian Unstable, using smbclient/smbfs 3.0.28a-1 to connect to a samba server (unix backend) on my university network. Server: Samba3.0.10-1.4E I mount the smb share in my fstab as follows: //myserver/jyoung/mnt/unismbfs credentials=credsfile,gid=jyoung,uid=jyoung,auto,rw smbfs is going out of support soon. You should be using cifsfs instead. Jeremy. -- James Young, B.Sc. Ph.D. Student Interactions laboratory, Department of Computer Science, University of Calgary 2500 University Drive NW, Calgary, Alberta, Canada, T2N 1N4 Phone: +1.403.210.9502 E-mail: [EMAIL PROTECTED] URL: http://pages.cpsc.ucalgary.ca/~jyoung/http://pages.cpsc.ucalgary.ca/%7Ejyoung/ -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba -- James Young, B.Sc. Ph.D. Student Interactions laboratory, Department of Computer Science, University of Calgary 2500 University Drive NW, Calgary, Alberta, Canada, T2N 1N4 Phone: +1.403.210.9502 E-mail: [EMAIL PROTECTED] URL: http://pages.cpsc.ucalgary.ca/~jyoung/http://pages.cpsc.ucalgary.ca/%7Ejyoung/ -- James Young, B.Sc. Ph.D. Student Interactions laboratory, Department of Computer Science, University of Calgary 2500 University Drive NW, Calgary, Alberta, Canada, T2N 1N4 Phone: +1.403.210.9502 E-mail: [EMAIL PROTECTED] URL: http://pages.cpsc.ucalgary.ca/~jyoung/ -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks issue
Thx for your help. Another question : What does this exactly means : vfs object = recycle:recycle recycle:repository = .deleted recycle:keeptree = Yes recycle:touch = Yes recycle:versions = Yes ? Max Liz Ackerman wrote: Maxime, you are still not telling me what files users are accessing and getting the message. Are they Microsoft Word and Excel and Access documents? Microsoft Office default templates??? I will explain what my users are doing and how I made that work. Each user has their own folder. They create, update, change and delete files in this folder and must have all ownership and accesses. In a Terminal session I ran a command of: chown ownername *.* -R to make the owner the user chgrp ownername *.* -R to make the group the user (if you setup users as groups too, I used a group called Everyone which all users are a member of) Then chmod g+s *.* -R to set the group and user on everything. The -R is to ensure that the permissions flow down the file structure, so all folders and files get set. In my Samba shares, here is how I set permissions: [home2]- this where all users have their own directory, so me I am liza comment = Everyone's Home Directory path = /home2 writeable = yes guest ok = yes [accting] - this is where the Accounting department have their Quickbooks files, you can see where I commented out things that didn't work :) I also use the force group and force user. Quickbooks is in multiuser mode, and it was the most challenging to get to work properly. Make sure you have a good backup copy of the database files if they get corrupted. We had several corruptions before I could get it to work. comment = Accounting Volume path = /accting writeable = yes valid users = liza, rhea, stephen, tammy oplocks = no level2 oplocks = no ; veto oplock files = /*.*db/*.ldb/*.mde/*.xls/*.qb*/*.QB*/*.LDB/*.L*/*.*/ ; blocking locks = no ; locking = yes ; strict locking = no ; share modes = no force group = accounting force user = root inherit permissions = yes create mask = 0771 directory mask = 0771 ; force create mode = 0777 ; force directory security mode = 0777 vfs object = recycle:recycle recycle:repository = .deleted recycle:keeptree = Yes recycle:touch = Yes recycle:versions = Yes [Data] - this is where all other folders and documents live. Anyone can access here and anyone can do anything to a file. Mostly Word and Excel, Powerpoint files. comment = Data path = /home2/Data writeable = yes guest ok = yes veto oplock files = /*.mdb/*.ldb/*.mde/ oplocks = no level2 oplocks = no blocking locks = no locking = no strict locking = no share modes = yes Hopefully you can try some of this and see if it works. Liz -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
RE: [Samba] File locks db (manually removing locks)
Okay, but then if the process signals back that is in fact not there, why then do the locks remain? I killed all smbd processes last night, and restarted samba alltogether before I went home. Upon running an smbstatus when I got in this morning, there are still a bunch of locks present for PIDs no longer running, some as old as April 1st still. Is there any utility to manually manipulate the db file these locks are stored in; or will simply deleting the db file after stopping all samba processes, allow the new instance to create a fresh (empty) database? - How do we remove the locks marked as present which really aren't? -- Nathan Vidican [EMAIL PROTECTED] Windsor Match Plate Tool Ltd. http://www.wmptl.com/ -Original Message- From: Jeremy Allison [mailto:[EMAIL PROTECTED] Sent: Monday, April 11, 2005 7:47 PM To: Nathan Vidican Cc: samba@lists.samba.org Subject: Re: [Samba] File locks db (manually removing locks) On Wed, Apr 06, 2005 at 07:53:32AM -0400, Nathan Vidican wrote: After killing an smbd process, or occasionally after a process has died itself, there remains a lock as indicated in an smbstatus output. The process ID tied to the file lock in the db is no longer active, yet the db entry still exists. Is there a way to manually manipulate the file locks db? If not, will any of these entries prohibit another smbd process from handling the file which is indicated as locked? Or will a new process simply validate the running/not running status of the process id indicated in the db before proceeding itself? Yes, that's what the smbd's do when finding an existing lock entry. They send a kill 0 signal to the process to validate its existence. Jeremy. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks db (manually removing locks)
Is there any utility to manually manipulate the db file these locks are stored in; or will simply deleting the db file after stopping all samba processes, allow the new instance to create a fresh (empty) database? - How do we remove the locks marked as present which really aren't? Why would you want to? What problems do they cause (other than making 'smbstatus' output look untidy? Mac Assistant Systems Adminstrator @nibsc.ac.uk [EMAIL PROTECTED] Work: +44 1707 641565 Everything else: +44 7956 237670 (anytime) -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
RE: [Samba] File locks db (manually removing locks)
Because we have been having problems with file locking issues, and need the output of smbstatus to debug and figure out who's got what locked and why they can't save. Aside from being un-tidy, these entries are becoming stale-dated and invalid anyhow; they stay there and make the output of smbstatus full of 'untidy' data which gets in the way of us solving the real problem - why a user can't save or is seeing an un-opened file as locked when it's not. -- Nathan Vidican [EMAIL PROTECTED] Windsor Match Plate Tool Ltd. http://www.wmptl.com/ -Original Message- From: David McCann [mailto:[EMAIL PROTECTED] On Behalf Of Mac Sent: Tuesday, April 12, 2005 9:53 AM To: Nathan Vidican Cc: [EMAIL PROTECTED] Subject: Re: [Samba] File locks db (manually removing locks) Is there any utility to manually manipulate the db file these locks are stored in; or will simply deleting the db file after stopping all samba processes, allow the new instance to create a fresh (empty) database? - How do we remove the locks marked as present which really aren't? Why would you want to? What problems do they cause (other than making 'smbstatus' output look untidy? Mac Assistant Systems Adminstrator @nibsc.ac.uk [EMAIL PROTECTED] Work: +44 1707 641565 Everything else: +44 7956 237670 (anytime) -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks db (manually removing locks)
On Tue, Apr 12, 2005 at 08:11:59AM -0400, Nathan Vidican wrote: Okay, but then if the process signals back that is in fact not there, why then do the locks remain? No, the smbd process that detected the problem should then remove that entry. I killed all smbd processes last night, and restarted samba alltogether before I went home. Upon running an smbstatus when I got in this morning, there are still a bunch of locks present for PIDs no longer running, some as old as April 1st still. These must be for files that have not been used since the owning process abended. You might be able to fix this be using smbclient to open the files listed. That should cause the cleanup. Jeremy. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks db (manually removing locks)
On Wed, Apr 06, 2005 at 07:53:32AM -0400, Nathan Vidican wrote: After killing an smbd process, or occasionally after a process has died itself, there remains a lock as indicated in an smbstatus output. The process ID tied to the file lock in the db is no longer active, yet the db entry still exists. Is there a way to manually manipulate the file locks db? If not, will any of these entries prohibit another smbd process from handling the file which is indicated as locked? Or will a new process simply validate the running/not running status of the process id indicated in the db before proceeding itself? Yes, that's what the smbd's do when finding an existing lock entry. They send a kill 0 signal to the process to validate its existence. Jeremy. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks not always released (Samba 2.2.8)
Hi Rasjid,Jeremy, We have the same problem as Rasjid said, But I'm working with an XFS and ACL's on files and dir (samba 3.0.4). I noticed that when a locked file (for samba) should NOT be locked, there was a problem of wrong autorizations on this file. --x missing or something similar according to what the samba user is autorized to do on this file. putting the good autorizations on, free the lock on this file, and you can do what you want next. look: The problem occured yesterday , I had a file on a share dmc called error.txt the share is root owner and group dmc owner. acl's when the problem occured said : user::r user:root:rwx group:dmc:rwx mask::rwx other::--- ls -l : r--rwx--- error.txt chmoding error.txt to (this is what I wanted before): rwxrwx--- error.txt unlock this file in samba point of view. The problem that I didn't anderstood is that I cannot say why I had : user::r user:root:rwx on file error.txt, cause it must have been : user::rwx user:root:rwx I think it was a copy of group of files from another NOVELL server that made this file r only for user root. I will do some others tests on these days, will keep you informed on this , ok ? Have a nice day Xavier Yes this is a reasonable thing to do. There was an issue in handling the lock database I fixed in 3.0.x recently, this code is similar in 2.2.x so it's possible this is a fixed bug. Your suggestion of a command to manually release a lock is a good one, I'll look at that for later releases. Thanks, Jeremy. -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba -- Xavier mailto: [EMAIL PROTECTED] -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
Re: [Samba] File locks not always released (Samba 2.2.8)
On Wed, Aug 11, 2004 at 03:18:08PM +1000, Rasjid Wilcox wrote: We have the occasional problem that file locks are not always being released. The result is files that insist on being 'read only' (claiming that the file is already 'in use') or that cannot be deleted or replaced. The problem only happens occasionally, and I have yet to be able to determine a pattern. The problem will usuall resolve itself within 24 hours, but sometimes it is very inconvenient. Firstly, is this a known issue with this version of Samba? If so, does it go away in later versions? Secondly, is there a way to 'manually' release a file lock on the server, for just a specific file? (I'm thinking of a command that could be run on the samba server itself.) Failing that, what about releasing all locks? Google seems to suggest that: Stopping Samba, removing /var/cache/samba/locking.tdb and restarting Samba would do that. Presumably this would be best to do after everyone has logged out of the system? Is this a reasonable thing to do, or is it likely to break something? Yes this is a reasonable thing to do. There was an issue in handling the lock database I fixed in 3.0.x recently, this code is similar in 2.2.x so it's possible this is a fixed bug. Your suggestion of a command to manually release a lock is a good one, I'll look at that for later releases. Thanks, Jeremy. -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba
Re: [Samba] file locks problem??
I suggest you get the latest samba version. I've been having similar problems with older versions, wich I solved disabling kernel oplocks: kernel oplocks = no If that doesn't solve your problem, try also level2 oplocks = no oplocks = no (note that this will reduce the performance since clients will no longer be able to cache files, so I suggest you get a newer samba/kernel) Boogerman - Original Message - From: Francesco Samba/ML [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 16, 2002 8:23 AM Subject: [Samba] file locks problem?? Hello, i am running Samba 2.2.3a on a Red Hat Linux 7.3 box with kernel 2.4.18-10. I am experiencing some problems on a particular samba share, which is accessed by 10 Windows 98SE clients working on a COBOL production packet by mapping with a G: letters this samba folder. Well, some times a day it happens that this packed blocks because some files on that samba folder remains locked; i also cannot browse this network drive because, when arriving to these locked files, windows explorer crash. By viewing samba logs i see that, i think!, the problem could be perhaps in a oplocks problem? [2002/11/16 11:15:45, 0] smbd/open.c:open_mode_check(551) open_mode_check: exlusive oplock left by process 20445 after break ! For file PROSYST/73002/73002DAT/SISTEMA, dev = 805, inode = 2588750. Deleting it to continue... [2002/11/16 11:15:45, 0] smbd/open.c:open_mode_check(555) open_mode_check: Existent process 20445 left active oplock. [2002/11/16 11:15:45, 0] tdb/tdbutil.c:tdb_log(475) tdb(/var/cache/samba/locking.tdb): tdb_lock failed on list 54 ltype=0 (Interrupted system call) [2002/11/16 11:22:09, 0] smbd/oplock.c:request_oplock_break(981) request_oplock_break: no response received to oplock break request to pid 20445 on port 32964 for dev = 805, inode = 3326030, file_id = 95 [2002/11/16 11:22:09, 0] smbd/open.c:open_mode_check(551) open_mode_check: exlusive oplock left by process 20445 after break ! For file PROSYST/PRO02/SYSMENU.LOG, dev = 805, inode = 3326030. Deleting it to continue... [2002/11/16 11:22:09, 0] smbd/open.c:open_mode_check(555) open_mode_check: Existent process 20445 left active oplock. [2002/11/16 11:22:09, 0] smbd/oplock.c:oplock_break(758) oplock_break: receive_smb error (Success) oplock_break failed for file PROSYST/PRO02/SYSMENU.LOG (dev = 805, inode = 3326030, file_id = 95). [2002/11/16 11:22:09, 0] smbd/oplock.c:oplock_break(843) oplock_break: client failure in break - shutting down this smbd. [2002/11/16 11:22:09, 0] tdb/tdbutil.c:tdb_log(475) tdb(/var/cache/samba/locking.tdb): tdb_lock failed on list 24 ltype=1 (Resource deadlock avoided) [2002/11/16 11:22:09, 0] tdb/tdbutil.c:tdb_log(475) tdb(/var/cache/samba/locking.tdb): tdb_lock failed on list 24 ltype=0 (Resource deadlock avoided) [2002/11/16 11:22:51, 0] smbd/oplock.c:request_oplock_break(981) request_oplock_break: no response received to oplock break request to pid 19083 on port 32927 for dev = 805, inode = 507948, file_id = 1856 [2002/11/16 11:22:51, 0] smbd/open.c:open_mode_check(551) open_mode_check: exlusive oplock left by process 19083 after break ! For file PROSYST/ISE02/ISE02DAT/NETUSER, dev = 805, inode = 507948. Deleting it to continue... [2002/11/16 11:22:51, 0] smbd/open.c:open_mode_check(555) open_mode_check: Existent process 19083 left active oplock. [2002/11/16 11:23:14, 0] smbd/oplock_linux.c:linux_oplock_receive_message(135) Invalid file descriptor 23 in kernel oplock break! The only way to repair this problem is restarting the SMB daemon. Could you please help me in order to solve this problem? Thank you again, best regards! Francesco Collini -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba -- To unsubscribe from this list go to the following URL and read the instructions: http://lists.samba.org/mailman/listinfo/samba