1819774 Members
3336 Online
109607 Solutions
New Discussion юеВ

lsof for 64 bit ?

 
someone_4
Honored Contributor

lsof for 64 bit ?

How do I compile lsof for a 64 bit system?

Richard
14 REPLIES 14
Uday_S_Ankolekar
Honored Contributor

Re: lsof for 64 bit ?

Hi,

Once you download 64 bit source code;
unzip and tar the file.
There are few files you must read . 00README and 00QUICKSTART for tips.

Run
./Configure hpux and answer all the questions (it's pretty easy..)
then run make
lsof -h for help

GoodLuck
-USA...

Good Luck..
Sridhar Bhaskarla
Honored Contributor

Re: lsof for 64 bit ?

Very Good question because hp-ux porting site doesn't have 64bit code for lsof. You need to compile it after downloading the source code.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
someone_4
Honored Contributor

Re: lsof for 64 bit ?

A. Clay Stephenson
Acclaimed Contributor

Re: lsof for 64 bit ?

Hi Richard:

You download the source and untar it into a directory. e.g. /usr/local/src. It will then untar into a dorectory below that - e.g. lsof-4.55. Cd to that directory and execute 'Configure'; if the Configure goes well type 'make'. It will then start compiling and linking. I have not tried this on a box without a development environment (Ansi/C or aCC) so I don't know it you can compile it using the bundled c compiler. In the worst case, you can download gcc and use it.

Clay
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: lsof for 64 bit ?

Have a look at the following thread. http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x56a672234586d5118ff00090279cd0f9,00.html

John Poff's response gives a link that should have a precompiled version of lsof for 64-bit HP-UX.
Uday_S_Ankolekar
Honored Contributor

Re: lsof for 64 bit ?

Hi, again..
lsof-4.55/00.README.FIRST file has all the compilation and installation instructions.

-USA..
Good Luck..
Santosh Nair_1
Honored Contributor

Re: lsof for 64 bit ?

I would strongly recommend that you compile your own. lsof is very OS specific and although most precompiled binaries *SHOULD* work, you may have problems. In any case, compiling from source is very simple. You should be able to get the latest version of lsof from ftp://vic.cc.purdue.edu/pub/tools/unix/lsof.

-Santosh
Life is what's happening while you're busy making other plans
Bill McNAMARA_1
Honored Contributor

Re: lsof for 64 bit ?

I had asked this question before under the title: lsof: FATAL: lsof was built for a 32 bit kernel
and John Poff Gave this link.


If you are looking for a compiled binary version for 64-bit, you can find one via anonymous ftp from wuarchive.wustl.edu/packages/security/lsof/binaries/hpux.


The search engine here really sucks btw..

Later,
bill
It works for me (tm)
someone_4
Honored Contributor

Re: lsof for 64 bit ?

/usr/local/src/lsof-4.55# ./Configure hpux
Configuring /dev/kmem-based HP-UX lsof

*****************************************
* *
* NOTICE! Configuring for 64 bit HP-UX *
* *
*****************************************

Looking for ipis_s with /usr/contrib/bin/q4 ...

!!!ERROR!!! /usr/contrib/bin/q4 failed and produced the following output.

q4: (warning) no modules in the crashdump or no INDEX file
q4: (error) vmunix not pxdb'd

!!!ERROR!!! !!!ERROR!!! !!!ERROR!!! !!!ERROR!!!
Configure can't use /usr/contrib/bin/q4 to examine the ipis_s
structure. You must do that yourself, report the result in
the HPUX_IPC_S_PATCH environment variable, then repeat the
Configure step. Consult the Configure script's use of
/usr/contrib/bin/q4 and the 00XCONFIG file for information
on ipis_s testing and the setting of HPUX_IPC_S_PATCH.
!!!ERROR!!! !!!ERROR!!! !!!ERROR!!! !!!ERROR!!!

/usr/local/src/lsof-4.55#
Santosh Nair_1
Honored Contributor

Re: lsof for 64 bit ?

Just shooting in the dark, but do you have the latest Q4 patch, i.e. PHCO_20262 installed on this system?

-Santosh
Life is what's happening while you're busy making other plans
Sridhar Bhaskarla
Honored Contributor

Re: lsof for 64 bit ?

Richard,

I had this problem. I tried my best finally ended up replacing the line

echo "yes\\nfields -c struct ipis_s" | $LSOF_TMP /stand/vmunix > $
{LSOF_TMPC}.out 2>&1

with echo ""

in Configure script.

Still my compiled lsof works!!!..

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
harry d brown jr
Honored Contributor

Re: lsof for 64 bit ?

Too much of a hassle to compile, so try these downloads:

For 10.20 and 11.00 get it here:

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

for 11.00/64:

http://www.wiretapped.net/security/host-security/lsof/binaries/hpux/B.11.00

for 11i get it here:

http://www.wiretapped.net/security/host-security/lsof/binaries/hpux/B.11.11/

live free or die

harry
Live Free or Die
Christopher Caldwell
Honored Contributor

Re: lsof for 64 bit ?

I've successfully cross-compiled 64-bit lsof with the HP-UX ANSI/C compiler on a 32-bit machine (I performed the final link on 64-bit HP-UX).

See 00XCONFIG.

As I recall, you had to define HPUX_KERNBITS to 64 if you're running on a 32-bit box.

Everything else was straight forward.

The link err'd out saying things like "I can't find lib such and so". I rcp'd the objects to a 64 bit machine for final link - everything worked just fine.

You should be able to make this work end-to-end
(64-bit built completely on a 32-bit box) - I was in a hurry, so I blew it off.
linuxfan
Honored Contributor

Re: lsof for 64 bit ?

Hi Richard,

If you are satisfied with the binaries, you can use them, i normally install it from the source code. For compiling the latest version of lsof 4.59, this is the procedure i followed,

I have a newer version of Q4 (version A.11.10.c (/usr/contrib/Q4/REVISION) with the patch PHCO_20262) on a box running 64 bit 11.0

so there were couple of things i had to do before able to compile lsof.

cp /stand/vmunix /stand/vmunix.lsof
pxdb /stand/vmunix.lsof
(if you don't run this, q4 complains saying the kernel is not ready for debugging and lsof tries to use the kernel in /stand/vmunix)

Also in the Configure script for lsof,
1. change the LSOF_TMP variable to /usr/contrib/Q4/bin/q4 (around line 1490)

2. change /stand/vmunix to /stand/vmunix.lsof
(two locations, lines 1460 and 1498)

./Configure hpux
make

test out lsof, if it works ok, do a make install.

At this point if you want, you may want
rm /stand/vmunix.lsof

and then everything should be ok. ;)

-Regards
Ramesh
They think they know but don't. At least I know I don't know - Socrates