Operating System - HP-UX
1753755 Members
4670 Online
108799 Solutions
New Discussion юеВ

lsof version 4.81 for HPUX 11.31

 
SOLVED
Go to solution
Johnson Punniyalingam
Honored Contributor

lsof version 4.81 for HPUX 11.31

Hi All,

Have Installed the lsof lsof version 4.81 for HPUX 11.31

But normal user id "coll" and "root" id lsof outputs are different.?

Example :-

# ll -l /usr/local/bin/
total 1632
-r-sr-xr-x 1 root bin 413096 Nov 6 00:16 lsof
-rwxr-xr-x 1 root bin 413096 Nov 6 00:16 lsof.bk


ROOT USER ID output
====================
# lsof -nP -i -C
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 549 beaadm 28u IPv4 0xe0000001b8ade700 0t0 TCP *:8686 (LISTEN)
java 549 beaadm 29u IPv4 0xe0000001b6e98680 0t0 TCP *:64514->127.0.0.1:64513 (CLOSING)
java 549 beaadm 31u IPv4 0xe00000017a94c400 0t0 TCP *:8009 (LISTEN)
java 549 beaadm 33u IPv4 0xe0000004078b3100 0t0 TCP 127.0.0.1:8886 (LISTEN)
syslogd 934 root 6u IPv6 0xe000000153055400 0t0 UDP *:514 (Idle)
sshd 1383 root 4u IPv6 0xe000000153323c80 0t0 TCP *:22 (LISTEN)
sshd 1383 root 5u IPv4 0xe000000153330100 0t0 TCP *:22 (LISTEN)
inetd 1431 root 5u IPv4 0xe000000142c70c80 0t0 TCP *:5555 (LISTEN)
kuxagent 1514 itm 5u IPv4 0xe0000001b8775400 0t0 TCP *:56959 (LISTEN)
kuxagent 1514 itm 6u IPv6 0xe0000001b8775700 0t0 TCP *:56960 (LISTEN)
kuxagent 1514 itm 7u IPv4 0xe0000001a02a8980 0t0 TCP *:56961 (LISTEN)
kuxagent 1514 itm 8u IPv6 0xe0000001b8ade400 0t0 TCP *:56962 (LISTEN)
kuxagent 1514 itm 9u IPv4 0xe0000001a02a8c80 0t0 TCP 127.0.0.1:56963 (LISTEN)
kuxagent 1514 itm 10u IPv4 0xe0000001a02a8080 0t0 TCP *:1920 (LISTEN)
kuxagent 1514 itm 11u IPv6 0xe0000001840e4680 0t0 TCP *:1920 (LISTEN)
kuxagent 1514 itm 12u IPv4 0xe0000001b8775d00 0t0 TCP *:3661 (LISTEN)
kuxagent 1514 itm 13u IPv6 0xe0000001a02a8380 0t0 TCP *:3661 (LISTEN)
kuxagent 1514 itm 14u IPv4 0xe0000001840e4380 0t0 TCP 127.0.0.1:56964->127.0.0.1:56963 (ESTABLISHED)


Normal user "Coll" ID ouput
============================
$ lsof -nP -i -C
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 3062 coll 5u IPv4 0xe0000001a02b6400 0t3452 TCP 10.8.63.30:22->10.8.86.10:1449 (ESTABLISHED)

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
7 REPLIES 7
Steven E. Protter
Exalted Contributor
Solution

Re: lsof version 4.81 for HPUX 11.31

Shalom,

I have found large Quality Assurance issues with this software.

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.81/

You may find the best route is to compile it yourself. Be sure to have all pre-requisites installed.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Johnson Punniyalingam
Honored Contributor

Re: lsof version 4.81 for HPUX 11.31

Shalom

SEP,

>>Be sure to have all pre-requisites installed.<<

Can please let me know the "pre-requisites installed" "I am lost " have keep trying many methods by changing the chmod 4555 /usr/local/bin/lsof still no help ..:(

Bunch of Thanks for you Quick concern and reply

Rgds,
Johnson
Problems are common to all, but attitude makes the difference
James R. Ferguson
Acclaimed Contributor

Re: lsof version 4.81 for HPUX 11.31

Hi:

> SEP: I have found large Quality Assurance issues with this software

I hope then that you have emailed the author and/or the Porting Centre. Bugs are a part of life even in the highest quality software. Would you mind sharing what it is you have found?

Regards!

...JRF...
Ganesan R
Honored Contributor

Re: lsof version 4.81 for HPUX 11.31

Hi Johnson,

I suspect you might be having more than one version of lsof on your server.

root and normal user may use different version depending upon the path they have assigned.

Can you use full path of lsof utililty for root and normal user and see how it gives the result?

Also check this..

#find / -name lsof -print

#whereis lsof --> for root as well as normal user
Best wishes,

Ganesh.
Johnson Punniyalingam
Honored Contributor

Re: lsof version 4.81 for HPUX 11.31

Hi Ganesan,

As requested,

# find / -name lsof -print
/usr/local/bin/lsof
/usr/local/doc/lsof
/var/adm/sw/products/lsof

[/home/root]
# whereis lsof
lsof: /usr/local/bin/lsof /usr/local/bin/lsof.bk /usr/local/man/man8/lsof.8

[/home/root]
# id
uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users)

[/home/root]
#


$ whereis lsof
lsof: /usr/local/bin/lsof /usr/local/bin/lsof.bk /usr/local/man/man8/lsof.8
$ id
uid=113(coll) gid=20(users)

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Matti_Kurkela
Honored Contributor

Re: lsof version 4.81 for HPUX 11.31

Normal (although compile-time optional) behaviour for lsof.

The lsof command must read kernel data structures to produce its output. These are readable only by root. Therefore lsof must be installed with "SUID root" permissions, if you want non-root users to be able to use it.

But lsof can detect the difference between running lsof as root and non-root user running lsof with SUID root permissions.

For a non-root user, lsof displays only data on the user's own processes.

To see all users' open files, you must be root.

If this behaviour is not acceptable for your situation, there are several ways to fix that:

a) allow the users to run lsof through sudo
or
b) download the lsof source package and recompile it on your own: the "configure" script in the source code package allows you to enable/disable this security feature.

The Porting Archive's lsof source package can be compiled using HP-UX's bundled cc compiler.

MK
MK
Johnson Punniyalingam
Honored Contributor

Re: lsof version 4.81 for HPUX 11.31

Hi All,

Thanks for all , you who have contributed their valueable time and Knowledge,

Special Thanks for <>

>>But lsof can detect the difference between running lsof as root and non-root user running lsof with SUID root permissions.<<

Solution :-
=========
allow the users to run lsof through sudo


In this Case my "perferred solution" was run lsof through sudo for normal user

Thanks,
Johnson
Problems are common to all, but attitude makes the difference