Cheers Paul for the info..
To explain, (with return comments) see below :)
>>>>> "BJ" == Baldwin James <Baldwin_James at emc.com> writes:
BJ> How do ya find out the PID's & UID's (and/or maybe parent
BJ> PID's of Child processes) which are locking a file?
lsof can tell which processes have a file open. I think it will also
indicate if the file is locked. Given the PID gleaned from lsof, you
can then use ps to get any other needed information.
BJ> How could you unlock the file from them without killing their
Paul asked: > Why would you want to do that? If you did do that, the
Paul asked: > process with the lock wouldn't know about it, so it would
Paul asked: > doing whatever it is doing to the locked region.
If a process is hung which has a log file locked for exclusive access, and
you wanna examine that log file without destroying the PID and then return
the lock back to the PID. I am basically trying to be as non-intrusive as
possible (this instance would be on a remote system).
BJ> How could you inform the user or push a std. file-handling
BJ> command to instruct the process to release the file?
Paul asked: > I'm not sure what you mean by this, to be honest.
Lets say, you are able to identify that Bob the Builder, (e.g. UID#505) has
Frags.log open and you want to use (Read/Write)that file. You need to
inform Bob to release/close that file so you can get it. How can you inform
Bob about this?
If Bob the builder is a process rather than a user, then is it possible for
some type of Unix/Linux directive to basically say "hey, Mr. Bob, I really
want to use that file you have locked. Please freeup that file and report
accordingly to User/Parent process that you had a request for that file, but
dont try to bomb out..."
(I would think the above request would be app-dependent unless coders follow
some type of practice like this????)
"Pity has no place at my table."
-- Dr Hannibal Lecter
Cork maillist - Cork at linux.iehttp://www.linux.ie/mailman/listinfo/cork
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!