Who locked the file

Status
Not open for further replies.

freenasbbs

Dabbler
Joined
Jan 9, 2014
Messages
37
hello,everybody!
Freenas 9.2.0
Zfs
Cifs

There one file can be edit by more than one user, if one user open this file and recevie the information : other user had opened this file now ,you only can open this file for read only.

Question:
how can i find out who eidt the file now ?
can i cut all connections for this file? if i can't find out who eidt it now

thanks help
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You will want to look at the command "smbstatus". That will tell you what files are locked and by who.
 

freenasbbs

Dabbler
Joined
Jan 9, 2014
Messages
37
Thank you very much!
Is there any way to close special connection but not by close cifs services or tell users to quit program.
i do this just for unlocked some file.
because some times,user had shutdowned his computer,but freenas still locked the file .
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
You could kill the process that the user is on with "kill -9 pid"
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
If you want to close only the file, you can connect to the freenas server via compmgmt.msc on a windows computer, view open files, and close the offending one. If you're in an ad environment it will require being domain admin. In a workgroup you will need to grant some rights to your user. I believe it requires sediskoperatorprivilege (net rpc rights grant [user] SeDiskOperatorPrivilege). Full list of rights can be viewed here: https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/rights.html
 
Last edited:
Status
Not open for further replies.
Top