1834599 Members
3618 Online
110069 Solutions
New Discussion

About lsof

 
SOLVED
Go to solution
Patrick Chim
Trusted Contributor

About lsof

Hi all,

I have downloaded the lsof 4.55 source code and want to compile in my machine as my system runs 64bit HP-UX 11.0.
However, it comes out the following error and the installation failed. Does anyone know what was happening ? Am I missing some environment variable ?

root@hp01:/ *) ./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
nm: invalid option -- h
Usage: nm [-aABCDglnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]
[--debug-syms] [--extern-only] [--print-armap] [--print-file-name]
[--numeric-sort] [--no-sort] [--reverse-sort] [--size-sort]
[--undefined-only] [--portability] [-f {bsd,sysv,posix}]
[--format={bsd,sysv,posix}] [--demangle] [--no-demangle] [--dynamic]
[--defined-only] [--line-numbers]
[--version] [--help]
[file...]
nm: supported targets: som srec symbolsrec tekhex binary ihex hpux-core
q4: (error) nm command exited, but not cleanly (status==0x100)

!!!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!!!

root@hp01:/ *) echo $HPUX_IPC_S_PATCH
sh: HPUX_IPC_S_PATCH: Parameter not set.
root@hp01:/ *) echo $ipis_s
sh: ipis_s: Parameter not set.

Regards,
Patrick
6 REPLIES 6
Carsten Krege
Honored Contributor
Solution

Re: About lsof

Check out the file Configure.cln of the lsof package and search for "q4". You will find the test that is done by the configure script to set the environment variable HPUX_IPC_S_PATCH.

The 00FAQ file gives more info:


9.2.6 Why does Configure complain about q4 for /dev/kmem-based lsof
for HP-UX 11?

When you run Configure on an HP-UX 11 system, it may complain:

!!!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!!!

This message states that Configure cannot use q4 from
/usr/contrib/bin to examine the kernel's boot image for
the ipis_s structure. That structure was introduced in
early 1999. Patch bundle B.11.00.43 and patches PHNE_20008
and PHNE_20735 appear to be responsible for ipis_s.

Note: q4 may also fail if it can't execute nm -- e.g., it
can't find /usr/bin/nm, or you have a conflicting, private
version of nm earlier in your path.

The ipis_s structure isn't described in any header file
HP-UX releases with HP-UX 11. It appears in the private
lsof header file .../dialects/hpux/kmem/hpux11/ipc_s.h.
I had to create ipc_s.h during the lsof port to HP-UX 11
by using q4. Lsof gets local and remote connection addresses
(IP and port numbers) from ipc_s, so an incorrect ipc_s
definition will cause incorrect reporting of TCP/IP connection
addresses.

Over the long run -- e.g., after the current patch has been
replaced by yet another one -- using q4 is the most reliable
way to tell if ipis_s exists and what it contains.

Unfortunately, q4 needs to be installed in /usr/contrib/bin
and the kernel boot image, /stand/vmunix, needs to be
processed with pxdb. If either is untrue, lsof issues the
above error message, perhaps preceded by q4 messages. For
example, if /stand/vmunix hasn't been processed by pxdb,
the q4 messages will include:

q4: (error) vmunix not pxdb'd
or
q4: (warning) /stand/vmunix has not been processed by pxdb.

To be able to complete HP-UX configuration of lsof, you
must determine if the ipis_s structure is defined in your
kernel, if the ipis_s structure of your kernel has an
ipis_msgsqueued member, and if the ipc_s structure of your
kernel uses has an ipc_ipis member. That means you may
have to process /stand/vmunix with pxdp, and perhaps install
q4 and run it on /stand/vmunix.

If you must run q4 to determine the state of ipis_s and
ipc_s, use these q4 commands:

$ /usr/contrib/bin/q4 /stand/vmunix
...
q4> fields -c struct ipis_s
...
q4> fields -c struct ipc_s

Look in the q4 output for the ipc_ipis member of the ipc_s
structure, and look in the ipis_s structure for the
ipis_msgsqueued member. If ipc_s has ipc_ipis but ipis_s
lacks ipis_msgsqueued, set HPUX_IPC_S_PATCH environment
variable to "1". If ipc_s has ipc_ipis and ipis_s has
ipis_msgsqueued, set HPUX_IPC_S_PATCH to "2" -- e.g.,

$ HPUX_IPC_S_PATCH=1 Configure -n hpux
or
$ HPUX_IPC_S_PATCH=2 Configure -n hpux
or
% setenv HPUX_IPC_S_PATCH 1
% Configure -n hpux
or
% setenv HPUX_IPC_S_PATCH 2
% Configure -n hpux

(Use setenv if your shell is csh.)

If ipc_s has no ipc_ipis member, set HPUX_IPC_S_PATCH
to "N" -- e.g., use this Configure step:

$ HPUX_IPC_S_PATCH=N Configure -n hpux
or
% setenv HPUX_IPC_S_PATCH N
% Configure -n hpux



Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Patrick Chim
Trusted Contributor

Re: About lsof

Carsten,

The previous part is ok but I encounter the following error

/bin/cc -Ae -DHPUXV=1100 -DHASVXFS -DHPUXKERNBITS=64 -I/tempdir/swbackup/lsof-4.55/dialects/hpux/kmem/hpux11 +DD64 -I/tempdir/swbac
kup/lsof-4.55/dialects/hpux/kmem -DLSOF_VSTR=\"B.11.00\" -O -c proc.c
/bin/cc -Ae -DHPUXV=1100 -DHASVXFS -DHPUXKERNBITS=64 -I/tempdir/swbackup/lsof-4.55/dialects/hpux/kmem/hpux11 +DD64 -I/tempdir/swbac
kup/lsof-4.55/dialects/hpux/kmem -DLSOF_VSTR=\"B.11.00\" -O -c store.c
Constructing version.h
/bin/cc -Ae -DHPUXV=1100 -DHASVXFS -DHPUXKERNBITS=64 -I/tempdir/swbackup/lsof-4.55/dialects/hpux/kmem/hpux11 +DD64 -I/tempdir/swbac
kup/lsof-4.55/dialects/hpux/kmem -DLSOF_VSTR=\"B.11.00\" -O -c usage.c
/bin/cc -o lsof -Ae -DHPUXV=1100 -DHASVXFS -DHPUXKERNBITS=64 -I/tempdir/swbackup/lsof-4.55/dialects/hpux/kmem/hpux11 +DD64 -I/tempd
ir/swbackup/lsof-4.55/dialects/hpux/kmem -DLSOF_VSTR=\"B.11.00\" -O dfile.o dmnt.o dnode.o dnode1.o dnode2.o dproc.o dsock.o dstor
e.o arg.o main.o misc.o node.o print.o proc.o store.o usage.o -L./lib -llsof -lelf -lnsl
ld: Missing library symbol table in ./lib/liblsof.a
Fatal error.
*** Error code 1

Stop.

Do you know what is the problem ?

Regards,
Patrick
Frank Li
Trusted Contributor

Re: About lsof

Check whether the current working directory has the file lib/liblsof.a !

$ll lib/liblsof.a

Note : you should go to the lsof-4.55 directory and run Configure

$cd /home/user/lsof-4.55
$./Configure hpux
Hi Friend
Printaporn_1
Esteemed Contributor

Re: About lsof

may be this is a stupid answer that
are you sure that you got 64 bits version of lsof ?
enjoy any little thing in my life
Carsten Krege
Honored Contributor

Re: About lsof

I tried to build it myself and it worked in all different flavours (HPUX_IPC_S_PATCH=N,1,2). If you post your email address and your HPUX_IPC_S_PATCH value, I can send you the version that you need.

I did noting else, but

# cd /tmp/lsof-4.55
# ./Configure hpux
# make

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Patrick Chim
Trusted Contributor

Re: About lsof

hi all,

I have corrected the mistake and can compile the lsof successfully.

Previous someone has installed other version of make, nm, ranlib, ... in /usr/local/bin and so cause the error.

I remove the linkage and compile OK then.

Sorry for any inconvience cause but I really appreciate for all your help.

Patrick