Stringer Leon (West Midlands Ambulance Service NHS Trust)
2007-Jan-12 15:42 UTC
[Samba] File Lock Timeout
Hi, I've seen posts (but no answers) about clearing a file lock on a Samba share. Presumably this kind of thing happens when the program abnormally terminates and doesn't close its open files. I've got a file that smbstatus reports as: 1216 DENY_WRITE 0x20089 RDONLY NONE /shares/share1/Files/december.xls Fri Jan 12 12:51:30 2007 Trying to open this in Excel says it's locked for editing by the user who reports that they definitely don't have it open. So I'm guessing this lock will eventually time out. But after how long? I can't find any documentation on this. But it looks like it's longer than 2 hours! Thanks for any help, Leon... ********************************************************************** Information in this message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************
On Fri, Jan 12, 2007 at 03:21:10PM +0000, Stringer Leon (West Midlands Ambulance Service NHS Trust) wrote:> I've seen posts (but no answers) about clearing a file > lock on a Samba share. Presumably this kind of thing > happens when the program abnormally terminates and doesn't > close its open files. > > I've got a file that smbstatus reports as: > > 1216 DENY_WRITE 0x20089 RDONLY NONE /shares/share1/Files/december.xls Fri Jan 12 12:51:30 2007 > > Trying to open this in Excel says it's locked for editing > by the user who reports that they definitely don't have it > open. > > So I'm guessing this lock will eventually time out. But > after how long? I can't find any documentation on this. > But it looks like it's longer than 2 hours!If the client who is being served by process 1216 is still around you should ask the user sitting at that box to close the file. If not, kill pid 1216 and the problem should solve itself. If this happens frequently to you, you might want to read about the option 'reset on zero vc' in the manpage of smb.conf. Volker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/samba/attachments/20070112/bcc06a15/attachment.bin
Stringer Leon (West Midlands Ambulance Service NHS Trust)
2007-Jan-12 16:03 UTC
[Samba] File Lock Timeout
>From: Volker Lendecke <Volker.Lendecke@SerNet.DE> >On Fri, Jan 12, 2007 at 03:21:10PM +0000, Stringer Leon (West Midlands Ambulance Service NHS Trust) wrote: >> I've seen posts (but no answers) about clearing a file >> lock on a Samba share. Presumably this kind of thing >> happens when the program abnormally terminates and doesn't >> close its open files. >> >> I've got a file that smbstatus reports as: >> >> 1216 DENY_WRITE 0x20089 RDONLY NONE /shares/share1/Files/december.xls Fri Jan 12 12:51:30 2007 >> >> So I'm guessing this lock will eventually time out. But >> after how long? I can't find any documentation on this. >> But it looks like it's longer than 2 hours! > >If the client who is being served by process 1216 is still >around you should ask the user sitting at that box to close >the file. If not, kill pid 1216 and the problem should solve >itself.Thanks for your reply. Unfortunately that doesn't help as the user is one of many on a terminal server and all files for that box are listed with pid 1216. So killing that would cause a lot of problems (I assume).>If this happens frequently to you, you might want to read >about the option 'reset on zero vc' in the manpage of >smb.conf.I'll check that out... ********************************************************************** Information in this message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************
Stringer Leon (West Midlands Ambulance Service NHS Trust)
2007-Jan-12 16:21 UTC
[Samba] File Lock Timeout
>From: Volker Lendecke <Volker.Lendecke@SerNet.DE> >On Fri, Jan 12, 2007 at 04:02:37PM +0000, Stringer Leon (West Midlands Ambulance Service NHS Trust) wrote: >> Thanks for your reply. Unfortunately that doesn't help as >> the user is one of many on a terminal server and all files >> for that box are listed with pid 1216. So killing that >> would cause a lot of problems (I assume). > >But then the file is still being held open by some process >on the file server.Yes, so either I have to wait for a timeout so the one user can edit their file or I can kill the process removing the locks for everyone else. So I have to wait, which was my original question, how long for? The lock has gone now, but this problem has happened before and is bound to happen again. If I remember correctly, Windows allows you to close the locks on individual files, it would be nice if Samba did this too... ********************************************************************** Information in this message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************
On Fri, Jan 12, 2007 at 04:20:56PM +0000, Stringer Leon (West Midlands Ambulance Service NHS Trust) wrote:> >But then the file is still being held open by some process > >on the file server. > > Yes, so either I have to wait for a timeout so the one > user can edit their file or I can kill the process > removing the locks for everyone else. So I have to wait, > which was my original question, how long for?This particular kind of lock (a share mode) does not have a timeout, this is completely client-driven.> The lock has gone now, but this problem has happened > before and is bound to happen again. If I remember > correctly, Windows allows you to close the locks on > individual files, it would be nice if Samba did this > too...Yep. Can you file a bug at bugzilla.samba.org with prio "enhancement" so that it does not get forgotten? Thanks, Volker -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.samba.org/archive/samba/attachments/20070112/ddbed4a1/attachment.bin
Stringer Leon (West Midlands Ambulance Service NHS Trust)
2007-Jan-12 20:55 UTC
[Samba] File Lock Timeout
>From: Volker Lendecke <Volker.Lendecke@SerNet.DE> >On Fri, Jan 12, 2007 at 04:20:56PM +0000, Stringer Leon (West Midlands Ambulance Service NHS Trust) wrote: >> The lock has gone now, but this problem has happened >> before and is bound to happen again. If I remember >> correctly, Windows allows you to close the locks on >> individual files, it would be nice if Samba did this >> too... > >Yep. Can you file a bug at bugzilla.samba.org with prio >"enhancement" so that it does not get forgotten?Sure: https://bugzilla.samba.org/show_bug.cgi?id=4338 Many thanks for your help! ********************************************************************** Information in this message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************