<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Courier New, Courier, monospace">When I ran "H - Bob
Stockler's lockinfo script", it was giving me filepro as the user
who had a record locked.<br>
By making the following change, I got the actual user name on the
TTY.<br>
<br>
snipet:<br>
<br>
# Get the user names, ttys and commands being executed:<br>
for i in $I<br>
do # Get user name, tty & command for the process holding
the lock:<br>
eval $( $PS -ef |<br>
$AWK -v PID="${PID[i]}" '<br>
$2 == PID { print "USER=" $1 ; print "TTY=" $6<br>
$1 = $2 = $3 = $4 = $5 = $6 = $7 = "" ;
sub(/^[ \t]+/,"")<br>
print "CMD=\"" $0 "\"" }' )<br>
# Print the results:<br>
<font color="#cc0000"><b>USER_NEW=`w | grep pts/0 | awk '{print
$1}'`</b></font><br>
$ECHO "<br>
filePro File: $PFNAME<br>
Record Number: ${REC_NUM[i]}<br>
User: <font color="#cc0000"><b>$USER_NEW</b></font><br>
TTY: $TTY<br>
PID: ${PID[i]}<br>
Command: $CMD"<br>
[[ $PROMPT = 1 ]] && PE<br>
<br>
The use of ps -ef does not give the actual user. <br>
i.e. <br>
filepro 7175 7172 0 11:01 pts/0 00:00:00 /appl/fp/dclerk<br>
<br>
But if you use w and grep for the tty you get the actual user. <br>
i.e.<br>
richard pts/0 99-101-38-43.lig 10:42 24:25 0.17s 0.00s
/appl/fp/runmenu<br>
<br>
<br>
Also, you could add:<br>
idle time for that user:</font><font face="Courier New, Courier,
monospace"><font color="#cc0000"><b> USER_IDLE=`w | grep pts/0 |
awk '{print $5}'`</b></font></font><br>
<font face="Courier New, Courier, monospace">user's ip connect
: </font><font face="Courier New, Courier, monospace"><font
color="#cc0000"><b>USER_IP=`w | grep pts/0 | awk '{print $3}'`</b></font></font><br>
<font face="Courier New, Courier, monospace"><br>
Then insert, User Idle: $USER_IDLE and $USER_IP, just below User:
$USER_NEW<br>
</font><font face="Courier New, Courier, monospace"><br>
I hope this is helpful,<br>
<br>
Richard D. Williams<br>
<br>
</font><br>
<br>
</body>
</html>