fix for lock.info
John Esak
john at valar.com
Wed Oct 4 17:21:55 PDT 2006
Richard,
Thanks, that is pretty useful... I din't realize that lock.info didn't give
the user.
John
-----Original Message-----
From: filepro-list-bounces+john=valar.com at lists.celestial.com
[mailto:filepro-list-bounces+john=valar.com at lists.celestial.com]On Behalf Of
Richard D. Williams
Sent: Tuesday, October 03, 2006 4:17 PM
To: filepro-list at lists.celestial.com
Subject: fix for lock.info
I don't know if anyone else has fixed this already, but I have noticed
when I run the lock.info script it always lists filepro as the user. This
makes it difficult to determine who really has a record locked. I have
added this line to the script and I find it works well.
# Get the user names, ttys and commands being executed:
for i in $I
do # Get user name, tty & command for the process holding the lock:
eval $( $PS -ef |
$AWK -v PID="${PID[i]}" '
$2 == PID { print "USER=" $1 ; print "TTY=" $6
$1 = $2 = $3 = $4 = $5 = $6 = $7 = "" ; sub(/^[
\t]+/,"")
print "CMD=\"" $0 "\"" }' )
# Print the results:
USER=`w | grep $TTY | awk '{print $1}'`
$ECHO "
filePro File: $PFNAME
Record Number: ${REC_NUM[i]}
User: $USER
TTY: $TTY
PID: ${PID[i]}
Richard D. Williams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.celestial.com/pipermail/filepro-list/attachments/20061004/6bbeb8ab/attachment.html
More information about the Filepro-list
mailing list