Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: mike_mattos on June 12, 2006, 06:11:31 PM

Title: Who is using a data file? How to tell?
Post by: mike_mattos on June 12, 2006, 06:11:31 PM
How in SME do you tell which users are accessing a file?

It seems that a file on a share used by Windows machines cannot be locked, windows error 1705, and I'm thinking somehow a lock wasn't removed by a previous user

Is there an SME technique or LINUX command to tell which users are using the file, and failing that, how to remove the lock without rebooting?

The file in question is the customer list, and is always in use during business hours, and is working properly in update mode, but file maintenace can't lock the file.

The file is owned by  a low security user, permission in rw.rw.rw.

I'm sure I could ( after hours ) connect as root & recreate the file, but surely there is a better way?
Title: Re: Who is using a data file? How to tell?
Post by: byte on June 12, 2006, 11:21:22 PM
Quote from: "mike_mattos"

Is there an SME technique or LINUX command to tell which users are using the file, and failing that, how to remove the lock without rebooting?


If rarely I have a lockup i use smbstatus then look for the file name and find out what process id it's using a kill it
Title: Who is using a data file? How to tell?
Post by: mike_mattos on June 13, 2006, 03:50:08 PM
Thanks, I'm half way there now, your suggestion will let me release the file, but it doesn't solve the problem of WHO is the villain!  ( and I'd like to figure out where the problem is coming from, a particular program, or a particular user or computer.

# smbstatus | grep 'myfile'

gives me the process# using 'myfile'

# ps | grep 'process#'  

gives me smbd  as the user, not particularly helpful since I already know it is a Windows/Samba problem.
Title: Who is using a data file? How to tell?
Post by: mmccarn on June 15, 2006, 05:05:01 PM
Try this -

# smbstatus | grep 'myfile'

# fgrep 'process#' /var/log/samba/*

Should give you both the computer and username you want.