Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The pre-compiled packages of lsof for Solaris (e.g. from Blastwave or sunfreeware) do not show the ports open, such as when using the options : "-Pni". The wisdom of the creator of lsof is that we should compile lsof ourselves. The tar bundle, configuration, etc., are very different than most open source packages one can compile from source. I'm running low on clues within the package to learn what is wrong with my build attempt.

I have Sun Studio 11 to provide C compiler. Also installed Gcc 3.4.5

The system is sparc, with ZFS on all file systems. OS is Solaris 10, U7.

uname -a
SunOS myhostname 5.10 Generic_141444-09 sun4u sparc SUNW,Sun-Fire-280R

lsof source is for 4.82. I configure with default options and ZFS support on.

With either cc or gcc, the failure when running make is similar:

gcc  -Dsolaris=100000  -DHASPR_GWINDOWS -m64 -DHASIPv6 -DHASSOUXSOUA -DHAS_IPCLASSIFIER_H -DHAS_CRED_IMPL_H -DHAS_V_PATH -DHASZONES -DHAS_ZFS=1 -DZFS_VERS=15 -DHASUTMPX -DHAS_VSOCK -DHAS_STRFTIME -DLSOF_VSTR=\"5.10\"  -O  -c  dnode.c
dnode.c: In function `process_node':
dnode.c:2082: error: structure has no member named `pcfs_entps'
*** Error code 1
make: Fatal error: Command failed for target `dnode.o'

I did get this to compile on a non-ZFS system with 4.77 many months ago, but I can't remember how.

share|improve this question

3 Answers 3

The lsof FAQ states that the necessary header files are not supplied by Sun and after the section quoted below goes on to suggest how to obtain them from Open Solaris and further problems that might be encountered.

17.27 Solaris 10 ZFS probblems [sic]

17.27.1 Why does Configure ask for the location of ZFS header files?

To provide ZFS support when lsof is compiled it needs to have
access to the definitions of ZFS structures used by the kernel.
Those definitions are contained in header files that Sun does
not distribute with Solaris 10.
share|improve this answer
    
It also says that the internal definitions from lsof can be used, and that is how I proceeded. I wouldn't expect that to trigger a compiling error. The mention of getting the header files uses the term "might" 3 times. Nothing very definitive about how to build it. I checked the URL to src.opensolaris.org and it wasn't obvious to me where to find the headers to try what "might" work. –  labradort Nov 17 '09 at 21:10
    
Well, the "structure has no member" message struck me as indicating a header file problem. –  Dennis Williamson Nov 17 '09 at 23:14
up vote 1 down vote accepted

I found this reference to the problem from googling on the part of the compile error

http://unix.derkeiler.com/Newsgroups/comp.unix.solaris/2009-07/msg00575.html

There is no need to get any header files from OpenSolaris or elsewhere. The beta version of 4.83 works on my Sparc ZFS box with defaults to the Configure script.

I now have a working lsof -Pni on Solaris 10.

share|improve this answer

While you're waiting for the real answer, you might give pcp a try as an alternative to lsof on solaris. It's built around the very useful solaris command pfiles.

share|improve this answer
    
Sorry, I should have followed your link. I found another thing called pcp - performance co-pilot, and checked into that. My previous comment was about performance co-pilot, which is more like sar, munin, etc. pcp the shell script does the task, but it is very slow compared to lsof. I'd prefer to have lsof working. –  labradort Nov 18 '09 at 18:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.