달력

4

« 2024/4 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

'lsof'에 해당되는 글 2

  1. 2008.11.12 LSOF 설치 및 사용가이드
  2. 2008.11.12 lsof - LiSt Open Files
2008. 11. 12. 13:58

LSOF 설치 및 사용가이드 Enjoy/etc2008. 11. 12. 13:58


출처 : http://unix.co.kr/bbs/board.php?bo_table=02_06&wr_id=6


LSOF 설치 및 사용가이드

2001. 6.30

공재순/ kong@certcc.or.kr

1. 소개

LSOF는 'List Open File'의 약자로, 해당 System에서 구동되고 있는 프로세스들에 의해서 열려진 파일들을 확인 할 수 있는 툴이다. 시스템의 의심스러운 프로세스에 대한 확인이 용이하고, 설치가 비교적 쉬워 많이 이용되고 있다.

[cert:root]:/user/kong/lsof_4.56> lsof
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sched 0 root cwd VDIR 32,0 1024 2 /
sched 0 root 0u VCHR 12,2 0t0 140375 /devices/pseudo/sad@0:user(COMMON)
.....
.....
sendmail 23403 root 13u inet 0x603ca5b8 0t2290 TCP cert:52969->211.45.162.90:smtp (ESTABLISHED)
sendmail 23403 root 14u inet 0x603ca5b8 0t2290 TCP cert:52969->211.45.162.90:smtp (ESTABLISHED)
......

[그림 1] LSOF 실행 예

Top

2. LSOF 다운로드 받기

최신 버전은 ftp://vic.cc.purdue.edu/pub/tools/unix/lsof 에서 확인 할 수 있으며, 여러 개의 Mirror site 가 존재해 쉽게 다운로드 받을 수 있다.

Mirror site URL :

* ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutiles/lsof
* ftp://ftp.cert.dfu.du/pub/tools/admin/lsof
* ftp://ftp.cetis.hvu.nl/pub/lsof
* ftp://ftp.crc.doc.ca/packages/

Version 4 LSOF 는 gzip으로 압축되어 있으며, 파일명에 revision number를 포함하고 있다.

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof_<rev>_W.tar.gz
또는 ftp://vic.cc.purdue.edu/pub/tools/unix/lsof_<rev>_W.tar.Z

※ 리눅스 시스템의 경우에는, 대부분 기본적으로 LSOF가 설치되어 있다. (만약 설치가 안되어 있는 상태라면 rpm 패키지로 배포하고 있으므로 linux 배포사이트를 이용하면 될 것이다.)

Top

3. 압축해제

이 문서에서는 ver.4(revision 4.56) LSOF를 Solaris OS에서 설치하는 과정을 보이도록 한다.

gzip -d lsof_4.56_W.tar.gz
tar -xvf lsof_4.56_W.tar

※ 참고로 4.56 버전의 lsof.tar 파일의 md5 checksum 값은 다음과 같으며, MD5 (lsof_4.56.tar) = 92155bb6430d14d044f8ca96858e63b8

md5 checksum tool은 아래 사이트에서 구할 수 있다.
ftp://ftp.cerias.purdue.edu/pub/tools/unix/crypto/md5

Top

4. 설치하기

LSOF 설치과정은 크게 압축해제 -> Inventory -> Configure -> Install 4단계로 볼 수 있다.

① 압축 풀기

우선 초기 Wrapper에 쌓인 파일 압축을 풀면 해당 디렉토리 내에 다음과 같은 5개 의 파일이 생성되고, 이와 함께 lsof_4.56 디렉토리가 생성된다.

[cert:root]:/user/kong> tar -xvf lsof_4.56_W.tar
x RELEASE.SUMMARY_4.56, 12803 bytes, 26 tape blocks
x README.lsof_4.56, 4129 bytes, 9 tape blocks
x 00.README.FIRST_4.56, 700 bytes, 2 tape blocks
x lsof_4.56.tar, 3317760 bytes, 6480 tape blocks
x lsof_4.56.tar.asc, 284 bytes, 1 tape blocks

생성되는 파일

설명

00.README.FIRST_4.56

Readme file for the distribution

README.lsof_4.56

Contains distribution and security information

RELEASE.SUMMARY_4.56

Summary of the lsof 4.56 distribution

lsof_4.56.tar

LSOF 4.56 tar archive

lsof_4.56.tar.asc

Detached PGP certificate for lsof_4.56.tar

[표 1] lsof_4.56_W.tar 압축 해지 후 생성되는 파일들

Top

※ 생성된 lsof_4.56 디렉토리에 생성되는 주요 파일들

[sparc5:root]:/user/kong/lsof_4.56> ls
./ 00DIST 00README arg.c lsof_fields.h proto.h
../ 00FAQ 00XCONFIG dialects/ main.c regex.h
00.README.FIRST 00LSOF-L AFSConfig* lib/ misc.c scripts/
00CREDITS 00MANIFEST Configure* lsof.8 node.c store.c
00DCACHE 00PORTING Customize* lsof.h print.c usage.c
00DIALECTS 00QUICKSTART Inventory* lsof.man proc.c version

② Inventory

LSOF를 설치 할때 절대적으로 필요한 과정은 아니다. 그러나 subdirectory들을 체크하고, 각 스크립트들과 파일 헤더들, 소스파일들이 실제로 존재하는지 등 패키지 상태를 체크 해 볼 필요가 있다. 다음과 같이 Inventory 스크립트를 실행하게 되면, inventory 작업에 대한 소개 가 나오고 실행할 것인지 여부를 물어오는데 'y' 로 답하면서 진행하게 되면 디렉토리들의 list 를 확인할 수 있다.

[cert:root]:/user/kong/lsof_4.56> ./Inventory
Conducting an inventory of the lsof distribution; this will take a while.
Examining /user/kong/lsof_4.56: OK
Examining dialects: OK
....
....
Examining lib: OK
Examining scripts: OK
This lsof distribution seems to be complete.

Top

③ Configure

환경설정에 필요한 여러 단계의 작업을 하게 되는데, 아래와 같이 해당 OS에 맞 게 선택하고 Configure 스크립트를 구동하면 된다.

※Configure 스크립트 구동방법

Configure <options> <target-dialect>
<options>: -clean : clean up previous configuration
-d|-dialects : display a list of supported dialect versions
-h|-help : display help information
-n : avoid AFS, customization, and inventory checks

aix | aixgcc : IBM AIX xlc (aix)
or gcc (aixgcc)
bsdi : BSDI BSD/OS
darwin : Apple Darwin
decosf : DEC OSF/1
digital_unix|du : Digital UNIX
freebsd : FreeBSD
hpux|hpuxgcc : HP-UX cc (hpux)
or gcc (hpuxgcc)
linux : Linux
netbsd : NetBSD

nextstep|next|ns|nxt : NEXTSTEP
openbsd : OpenBSD
openstep|os : OpenStep
osr | sco : SCO OpenServer,
SCO devloper's compiler
osrgcc|scogcc : SCO OpenServer,gcc compiler
ptx : Sequent PTX
solaris | solariscc : Solaris gcc (solaris)
or cc(solariscc)
tru64 : Tru64 UNIX
unixware | uw : SCO UnixWare

[표 2] Configure 스크립트 구동시 OS 지정

Top

[sparc5:root]:/user/kong/lsof_4.56> ./Configure solaris
Testing prdata.h for PR_GWINDOWS, using gcc
Testing prdata.h for PR_LDT, using gcc
Testing vnode.h for VSOCK, using gcc
.....

각 헤더파일 testing이 끝나면, 다시 inventory 해 볼 것인지를 물어보는데 file tree들을 변화시킬 것이 없다면 inventory과정을 re-run할 필요없다.

....
....
Do you want to take inventory (y|n) [y]? n
rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c dstore.c kernelbase.h machine.h machine.h.old new_machine.h __lseek.s Makefile
ln -s dialects/sun/ddev.c ddev.c
ln -s dialects/sun/dfile.c dfile.c
ln -s dialects/sun/dlsof.h dlsof.h
.....
ln -s dialects/sun/machine.h machine.h
kernelbase.h assembled.
Makefile and lib/Makefile created.

Top

위 과정에서 Make 파일이 생성됨을 볼 수 있으며, 이어 LSOF를 customize 할 것인지를 물어오는데 [yes/no] question을 따라 다음의 각 옵션을 사용자가 선택할 수 있다.

Name

Description

Default Value

HASSECURITY

enabled : root 만이 lsof를 이용해 열려진 파일들을 확인 할 수 있음.
disabled :누구든 모든 열려진 파일들을 lsof를 이 용해 확인 할 수 있음.

Disabled

WARNINGSTATE

enabled : lsof가 필요할 경우 언제든지 warning messages를 출력함.
disabled : warning messages를 출력하지 않음. -w (disables) +w (enables) 로 조절 가능함.

Enabled

WARNDEVACCESS

enabled : lsof가 /dev (또는 /devices)를 억세스 할 수 없을 때, warning messages를 출력함.
disabled : lsof가 /dev (또는 /devices)를 억세스 할 수 없을 때, skip 해 버림.

Enabled

HASDCACHE

enabled : lsof가 /dev (또는 /devices)의 파일들에 관한 정보를 포함하고 있는
device cache file을 생성함.

< define path options >

HASENVDC, HASPERSDC,
HASPERSDCPATH, HASSYSDC
disabled : lsof 가 device cache file 생성하지 않음.

Enabled

HASENVDC

HASPERSDC

HASPERSDCPATH

HASDCACHE를 정의하면, device cache file path를 기술하기 위해 연관된
다른 옵션들의 구성도 정의해 주어야 한다.

< 현재 설정된 path options >

#define HASENVDC "LSOFDEVCACHE"
#define HASPERSDC "%h/%p.lsof_%L"
#define HASPERSDCPATH "LSOFPERSDCPATH"
※ 자세한 사항은 00DCACHE ,00FAQ 참고

"LSOFDEVCACHE"

"%h/%p.lsof_%L"

"LSOFPERSDCPATH"

HASKERNIDCK

lsof가 현재의 커널상태와 최초 lsof가 설치되어 구동되었을 당시의 커널과 비교하여,
시스템에서 부적절하게 실행되는 것을 탐지할 수 있다.

kernel identity check로 인해 일부 UNIX
(예:AIX) 시스템에서 구동시간이 많이 걸리는 경우가 있어서 disable 시켜야 할 때가 있을 수도 있지만,
lsof를 부적절하게 구동함으로써 오는 위험요소가 증가할 수 있다는 것을 배제할 수 없다.

Enabled

[표 3] Customize 옵션

Top

위의 각 항목들 및 설정값들은 LSOF가 기본적으로 제공하는 것으로 변경을 원할 경우에는 machine.h 파일을 직접 수정하거나 Customize 스크립트를 직접 구동하여 변경할 수도 있다.

④ build & install

Configure 과정을 마치고 나면, 시스템에 인스톨 할 수 있다. 기본적인 install 과 정은 아래와 같다.

■ build LSOF system

[cert:root]:/user/kong/lsof_4.56> make
(cd lib; make DEBUG="-O" CFGF="-Dsolaris=20600 -DHASPR_GWINDOWS -DHAS_VSOCK -DLSOF_VSTR=\"5.6\"")
gcc -Dsolaris=20600 -DHASPR_GWINDOWS -DHAS_VSOCK -DLSOF_VSTR="5.6" -O -c ckkv.c
.....
.....
gcc -o lsof -Dsolaris=20600 -DHASPR_GWINDOWS -DHAS_VSOCK -DLSOF_VSTR=\"5.6\" -O ddev.o dfile.o dmnt.o dnode.o dnode1.o dnode2.o dproc.o dsock.o dstore.o arg.o main.o misc.o node.o print.o proc.o store.o usage.o -L./lib -llsof -lkvm -lelf -lsocket -lnsl

Top

■ Install LSOF system

[cert:root]:/user/kong/lsof_4.56> make install
(cd lib; make DEBUG="-O" CFGF="-Dsolaris=20600 -DHASPR_GWINDOWS -DHAS_VSOCK -DLSOF_VSTR=\"5.6\"")
Constructing version.h
gcc -Dsolaris=20600 -DHASPR_GWINDOWS -DHAS_VSOCK -DLSOF_VSTR=\"5.6\" -O -c usage.c
gcc -o lsof -Dsolaris=20600 -DHASPR_GWINDOWS -DHAS_VSOCK -DLSOF_VSTR=\"5.6\" -O ddev.o dfile.o dmnt.o dnode.o dnode1.o dnode2.o dproc.o dsock.o dstore.o arg.o main.o misc.o node.o print.o proc.o store.o usage.o -L./lib -llsof -lkvm -lelf -lsocket -lnsl

여기까지 과정을 마치면 일반적인 설치는 모두 끝나고 lsof 실행파일이 생성된다.

※ 별도로 install ruleset 지정하고자 할 경우

가상메모리의 커널 image를 담고있는 파일인 /dev/kmem(또는 /dev/mem)를 read 할 수 있도록 LSOF는 setgid 로 설치되어야 하는데, 일반적으로 다음과 같은 ruleset 형태로 지정한다.

SunOS install rule actions :
install <options> -m 2755 -g kmem lsof <bin_dest>
install <options> -m 444 lsof.8 <man_dest>
Solaris install rule actions :

install -[cf] <bin_dest> <options> -m 2755 -g sys lsof
install -[cf] <man_dest> <options> -m 444 lsof.8

Top

5. LSOF 사용하기

■ LSOF 옵션

옵션

기 능

옵션

기 능

-?
-h

list help

-a

AND selections (OR)

-d
-D

s select by FD set
D ?|i|b|r|u[path]

+|-f

-files +filesys

-l

list UID numbers

-n
-N

no host names
select NFS files

-s

list file size

-t
-T

terse listing
disable TCP/TPI info

-v
-V

display version info
verbose search

-F [f]

select fields;-F? for help

-o o

o 0t offset digits (8)

-S [t]

t second stat timeout(15)

-i i

select by IPv4 address: [proto][@host|addr][:svc_list|port_list]

+|-r [t]

repeat every t seconds (15);
+ until no files, - forever

-b

avoid kernel blocks

-c c

list command c

-P

no port names

-i

select IPv4 files

-p s

select by PID set

-C

no kernel name cache

+|-w

Warnings (+)

-R

list paRent PID

-k k

kernelsymbols (/dev/ksyms)

-U

select Unix socket

-u s

exclude(^)/select login/UID s

-m m

kernel memory (/dev/kmem)

+|-M

portMap registration (-)

--

end option scan

-g [s]

select by process group ID set and print process group IDs

names

select named files or files on named file systems

Top

■ 실행결과 보기

실행결과에 해당되는 각 column 들을 간단하게 살펴보면 다음 [표5] 와 같다.

Column

설 명

Command

프로세스와 관련된 Unix command 이름

PID
PPID
PGRP

Process IDentification number

Parent Process IDentification number
(해당 프로세스의 부모 프로세스 ID)

Process Group IDentification number
(해당 프로세스와 관련된 프로세스 그룹 ID)

USER

해당 프로세스를 소유한 사용자 ID 또는 login name

FD

File Descriptor number
(ex) cwd : current working directory
r : read access / w : write access / u : read and write access

TYPE

해당 파일과 관련한 노드 타입
(ex) inet : Internet domain socket

DEVICE

device number

SIZE
SIZE/OFF
OFFSET

file 이나 file offset의 사이즈

INODE
NODE-ID

local file 의 node number 또는 Internet protocol type
또는 서버 호스트의 NFS file의 inode number

NAME

해당 파일이 소속된 mount point나 파일 시스템의 이름

[표 6] lsof 실행결과의 각 Column

Top

■ LSOF 주요 옵션 사용 예

* 특정 파일을 억세스하고 있는 프로세스 확인 : lsof <path/file-name>

[cert:root]:/> lsof /etc/passwd
COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
ns-httpd 244 root 9r VREG 32,0 3044 99217 /etc/passwd
....

* internet socket 확인 : lsof -i

Internet address 출력형식 : [protocol][@hostname|hostaddr][:service|port]

Top

- 특정 호스트(또는 ip)에 대한 접속 확인

[cert:root]:/> lsof -i@172.16.2.146
COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
in.telnet 10124 root 0u inet 0x61d4b788 0t71 TCP cert:telnet->172.16.2.146:1109 (ESTABLISHED)
in.telnet 10124 root 1u inet 0x61d4b788 0t71 TCP cert:telnet->172.16.2.146:1109 (ESTABLISHED)
in.telnet 10124 root 2u inet 0x61d4b788 0t71 TCP cert:telnet->172.16.2.146:1109 (ESTABLISHED)
.....

- 특정 포트로 접속한 리스트 확인

[cert:root]:/usr/sbin> lsof -i @certcc.or.kr:23
COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
in.telnet 104 root 2u inet 0x612df850 0t152 TCP cert:telnet->172.16.2.159:1176 (ESTABLISHED)
in.telnet 28462 root 0u inet 0x61aee578 0t71 TCP cert:telnet->172.16.2.146:4250 (ESTABLISHED)
.....

Top

* 특정 user가 오픈한 프로세스를 확인 : lsof -u <loginname> 혹은 lsof -u <UID>

[cert:root]:/> lsof -u kong
COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
csh 21309 kong cwd VDIR 32,4 1536 223602 /user/kong/lsof_4.56
csh 21309 kong txt VREG 32,6 158608 298136 /usr/bin/csh
.......

- 특정사용자 제외시 "^" 심볼을 사용하고, 여러명을 동시에 지정하려면 ","를 이용한다.

[cert:root]:/dev/pts> lsof -u ^root,kong,yjkim
COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
csh 8992 yjkim cwd VDIR 32,0 1024 2 /
csh 8992 yjkim txt VREG 32,6 158608 298136 /usr/bin/csh
csh 8992 yjkim txt VREG 32,6 70996 136979 /usr/lib/locale/ko/ko.so.1
csh 8992 yjkim txt VREG 32,6 1024888 6749 /usr/lib/libc.so.1
.....
csh 21309 kong cwd VDIR 32,4 1536 223602 /user/kong/lsof_4.56
csh 21309 kong txt VREG 32,6 158608 298136 /usr/bin/csh
....

Top

* 특정 프로세스가 오픈한 파일 리스트 확인 : lsof -p <PID>

- PID 112를 가진 프로세스가 사용하는 파일들 확인

[cert:root]:/usr/sbin> lsof -p 143
COMMAND PID USER FD TYPE DEVICE SIZE/OFF INODE NAME
inetd 143 root cwd VDIR 32,0 1024 2 /
inetd 143 root txt VREG 32,6 33492 310933 /usr/sbin/inetd
inetd 143 root txt VREG 32,6 10696 6352 /usr (/dev/dsk/c0t0d0s6)
....
....
inetd 143 root 4u inet 0x603cab38 0t0 TCP *:ftp (LISTEN)
inetd 143 root 5u inet 0x610b13c0 0t0 TCP *:telnet (LISTEN)
inetd 143 root 6u inet 0x610b1240 0t0 TCP *:pop3 (LISTEN)
......

Top

* ps 명령이 변조된 시스템에서는 의심스러운 포트 확인하기 예

[root@linux /root]# netstat -a
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:auth *:* LISTEN
tcp 0 0 *:ftp *:* LISTEN
tcp 0 0 *:telnet *:* LISTEN
tcp 0 0 *:login *:* LISTEN
tcp 0 0 *:2626 *:* LISTEN
.......
[root@linux /dev]# fuser -n tcp 2626
2626/tcp: 607
[root@linux /dev]# lsof -p 607
PID TTY STAT TIME COMMAND
607 ? S 0:00 /usr/sbin/mingetty

※ 참고자료

1. lsof 4.56 README file and man page

2. Installing, configuring and using lsof 4.50 to list open files on systems running Solaris 2.x
http://www.cert.org/security-improvement/implementations/i042.05.html

:
Posted by 라면스프
2008. 11. 12. 13:31

lsof - LiSt Open Files Enjoy/etc2008. 11. 12. 13:31

lsof (LiSt Open Files) version 4  (revision 4.49)

출처 : http://www.javaservice.net/~java/bbs/read.cgi?m=etc&b=unix&c=r_p&n=959319048


javaservice:/usr/src/# ftp ftp.cert.dfn.de
Connected to concert.cert.dfn.de.
220- \ \ \
220-  ) ) )      The DFN-CERT  / DFN-PCA AnonFtp Archive
220- / / /
220- \ \ \       --------------------------------------------
220- | | |
220- | | |       If you want to contact the DFN-CERT directly
220- | | |       send electronic mail to:
220- | | |
220- | | |            dfncert@cert.dfn.de  (Incidents)
220- | | |       or
220- | | |            ftp@cert.dfn.de      (AnonFtp Server)
220- | | |       or
220- | | |            dfnpca@pca.dfn.de    (DFN-PCA)
220- | | |
220- | | |       The information and tools on this server are
220- | | |       provided "as is". No responsibility is taken
220-   | |       by neither DFN-CERT nor DFN-PCA.
220-   | |
220-     |       All traffic is logged and analysed, if you
220-     |       do not accept this policy, do not log in!
220-
220-Local time in Hamburg, Germany, is Fri Jun 23 09:06:09 2000
220-
220 concert.cert.dfn.de FTP server (Version wu-2.6.0-dfncert(2) Wed May 17 16:33:20
MET DST 2000) ready.
Name (ftp.cert.dfn.de:root): guest
331 Guest login ok, send your complete e-mail address as password.
Password:
230-The response 'guest' is not valid
230-Next time please use your e-mail address as your password
230-        for example: joe@210.220.251.96
230-
230-If you have comments or recommendations concerning this server please
230-contact the local administrators by email: ftp@cert.dfn.de
230-
230-Check also our WWW server:
230-
230-      German language:     http://www.cert.dfn.de/
230-      English language:    http://www.cert.dfn.de/eng/
230-
230 Guest login ok, access restrictions apply.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub/tools/admin/lsof
250 CWD command successful.
ftp> bin
ha200 Type set to I.
ftp> ha
Hash mark printing on (1024 bytes/hash mark).
ftp> asc
200 Type set to A.
ftp> get README
local: README remote: README
200 PORT command successful.
150 Opening ASCII mode data connection for README (13251 bytes).
##############
226 Transfer complete.
13597 bytes received in 1.15 secs (12 Kbytes/sec)
ftp> bin
200 Type set to I.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 1572
-rw-rw-r--   1 infosys    28540 Jun  1 23:19 .mirror
-rw-rw-r--   1 infosys    13251 Apr  3 18:28 README
lrwxrwxrwx   1 infosys       18 May  1 23:10 lsof.tar.gz -> lsof_4.49_W.tar.gz
-rw-rw-r--   1 infosys   751995 Apr  3 10:56 lsof_4.49_W.tar.gz
226 Transfer complete.
ftp> get lsof_4.49_W.tar.gz
local: lsof_4.49_W.tar.gz remote: lsof_4.49_W.tar.gz
200 PORT command successful.
150 Opening BINARY mode data connection for lsof_4.49_W.tar.gz (751995 bytes).
####################################################################################
####################################################################################
####################################################################################
####################################################################################
####################################################################################
####################################################################################
####################################################################################
####################################################################################
##############################################################
226 Transfer complete.
751995 bytes received in 496 secs (1.5 Kbytes/sec)
ftp> quit
221-You have transferred 765592 bytes in 2 files.
221-Total traffic for this session was 768123 bytes in 3 transfers.
221-Thank you for using the FTP service on concert.cert.dfn.de.
221 Goodbye.
javaservice:/usr/src/# dir
total 764
   4 drwxr-xr-x   2 root     root         4096 Jun 23 16:10 ./
   4 drwxr-xr-x   5 guest    users        4096 Jun 23 16:09 ../
  16 -rw-r--r--   1 root     root        13251 Jun 23 16:10 README
740 -rw-r--r--   1 root     root       751995 Jun 23 16:19 lsof_4.49_W.tar.gz
javaservice:/usr/src/# mkdir lsof
javaservice:/usr/src/# cd lsof
javaservice:/usr/src/lsof# tar xvfz ../lsof_4.49_W.tar.gz

RELEASE.SUMMARY_4.49
README.lsof_4.49
00.README.FIRST_4.49
lsof_4.49.tar
lsof_4.49.tar.asc
javaservice:/usr/src/lsof# dir
total 3044
   4 drwxr-xr-x   2 root     root         4096 Jun 23 16:21 ./
   4 drwxr-xr-x  10 root     root         4096 Jun 23 16:21 ../
   4 -rw-r--r--   1 701      1233          700 Apr  4 00:55 00.README.FIRST_4.49
   8 -rw-r--r--   1 701      1233         4132 Apr  4 00:55 README.lsof_4.49
  16 -r--r--r--   1 701      1233        13251 Apr  4 00:55 RELEASE.SUMMARY_4.49
3004 -rw-r--r--   1 701      1233      3072000 Apr  4 00:54 lsof_4.49.tar
   4 -rw-r--r--   1 701      1233          284 Apr  4 00:55 lsof_4.49.tar.asc
javaservice:/usr/src/lsof# tar xvf lsof_4.49.tar
lsof_4.49/
lsof_4.49/00.README.FIRST
lsof_4.49/00CREDITS
lsof_4.49/00DCACHE
lsof_4.49/00DIALECTS
lsof_4.49/00DIST
lsof_4.49/00FAQ
lsof_4.49/00LSOF-L
lsof_4.49/00MANIFEST
lsof_4.49/00PORTING
lsof_4.49/00QUICKSTART
lsof_4.49/00README
lsof_4.49/00XCONFIG
lsof_4.49/AFSConfig
lsof_4.49/Configure
lsof_4.49/Customize
lsof_4.49/Inventory
lsof_4.49/dialects/
lsof_4.49/dialects/n+os/
lsof_4.49/dialects/n+os/dproc.c
lsof_4.49/dialects/n+os/Mksrc
lsof_4.49/dialects/n+os/dnode.c
lsof_4.49/dialects/n+os/dlsof.h
lsof_4.49/dialects/n+os/Makefile
lsof_4.49/dialects/n+os/dsock.c
lsof_4.49/dialects/n+os/machine.h
lsof_4.49/dialects/n+os/dproto.h
lsof_4.49/dialects/n+os/dnode1.c
lsof_4.49/dialects/n+os/dstore.c
lsof_4.49/dialects/ultrix/
lsof_4.49/dialects/ultrix/Makefile
lsof_4.49/dialects/ultrix/dlsof.h
lsof_4.49/dialects/ultrix/dmnt.c
lsof_4.49/dialects/ultrix/dnode.c
lsof_4.49/dialects/ultrix/dproc.c
lsof_4.49/dialects/ultrix/dproto.h
lsof_4.49/dialects/ultrix/dsock.c
lsof_4.49/dialects/ultrix/dstore.c
lsof_4.49/dialects/ultrix/machine.h
lsof_4.49/dialects/ultrix/Mksrc
lsof_4.49/dialects/aix/
lsof_4.49/dialects/aix/dnode1.c
lsof_4.49/dialects/aix/dlsof.h
lsof_4.49/dialects/aix/Mksrc
lsof_4.49/dialects/aix/ddev.c
lsof_4.49/dialects/aix/dproto.h
lsof_4.49/dialects/aix/machine.h
lsof_4.49/dialects/aix/Makefile
lsof_4.49/dialects/aix/dfile.c
lsof_4.49/dialects/aix/dnode.c
lsof_4.49/dialects/aix/dmnt.c
lsof_4.49/dialects/aix/dproc.c
lsof_4.49/dialects/aix/dsock.c
lsof_4.49/dialects/aix/dstore.c
lsof_4.49/dialects/sun/
lsof_4.49/dialects/sun/machine.h
lsof_4.49/dialects/sun/dproc.c
lsof_4.49/dialects/sun/Mksrc
lsof_4.49/dialects/sun/dsock.c
lsof_4.49/dialects/sun/include/
lsof_4.49/dialects/sun/include/sys/
lsof_4.49/dialects/sun/include/sys/auxv.h
lsof_4.49/dialects/sun/dnode2.c
lsof_4.49/dialects/sun/dfile.c
lsof_4.49/dialects/sun/dnode.c
lsof_4.49/dialects/sun/ddev.c
lsof_4.49/dialects/sun/dstore.c
lsof_4.49/dialects/sun/Makefile
lsof_4.49/dialects/sun/dproto.h
lsof_4.49/dialects/sun/dmnt.c
lsof_4.49/dialects/sun/dnode1.c
lsof_4.49/dialects/sun/dlsof.h
lsof_4.49/dialects/freebsd/
lsof_4.49/dialects/freebsd/Mksrc
lsof_4.49/dialects/freebsd/dnode.c
lsof_4.49/dialects/freebsd/dlsof.h
lsof_4.49/dialects/freebsd/dmnt.c
lsof_4.49/dialects/freebsd/dnode1.c
lsof_4.49/dialects/freebsd/include/
lsof_4.49/dialects/freebsd/include/procfs/
lsof_4.49/dialects/freebsd/include/procfs/pfsnode.h
lsof_4.49/dialects/freebsd/Makefile
lsof_4.49/dialects/freebsd/dsock.c
lsof_4.49/dialects/freebsd/dstore.c
lsof_4.49/dialects/freebsd/machine.h
lsof_4.49/dialects/freebsd/dproc.c
lsof_4.49/dialects/freebsd/dproto.h
lsof_4.49/dialects/hpux/
lsof_4.49/dialects/hpux/kmem/
lsof_4.49/dialects/hpux/kmem/Makefile
lsof_4.49/dialects/hpux/kmem/Mksrc
lsof_4.49/dialects/hpux/kmem/dfile.c
lsof_4.49/dialects/hpux/kmem/dlsof.h
lsof_4.49/dialects/hpux/kmem/dmnt.c
lsof_4.49/dialects/hpux/kmem/dnode.c
lsof_4.49/dialects/hpux/kmem/dnode1.c
lsof_4.49/dialects/hpux/kmem/dnode2.c
lsof_4.49/dialects/hpux/kmem/dproc.c
lsof_4.49/dialects/hpux/kmem/dproto.h
lsof_4.49/dialects/hpux/kmem/dsock.c
lsof_4.49/dialects/hpux/kmem/dstore.c
lsof_4.49/dialects/hpux/kmem/machine.h
lsof_4.49/dialects/hpux/kmem/hpux11/
lsof_4.49/dialects/hpux/kmem/hpux11/rnode.h
lsof_4.49/dialects/hpux/kmem/hpux11/vnode.h
lsof_4.49/dialects/hpux/kmem/hpux11/kernbits.h
lsof_4.49/dialects/hpux/kmem/hpux11/proc.h
lsof_4.49/dialects/hpux/kmem/hpux11/nfs_clnt.h
lsof_4.49/dialects/hpux/kmem/hpux11/lla.h
lsof_4.49/dialects/hpux/kmem/hpux11/sth.h
lsof_4.49/dialects/hpux/kmem/hpux11/ipc_s.h
lsof_4.49/dialects/hpux/kmem/hpux11/udp_s.h
lsof_4.49/dialects/hpux/kmem/hpux11/tcp_s.h
lsof_4.49/dialects/linux/
lsof_4.49/dialects/linux/kmem/
lsof_4.49/dialects/linux/kmem/patches/
lsof_4.49/dialects/linux/kmem/patches/Linux-mouse-module.patch
lsof_4.49/dialects/linux/kmem/Makefile
lsof_4.49/dialects/linux/kmem/Makefile.lseek
lsof_4.49/dialects/linux/kmem/Mksrc
lsof_4.49/dialects/linux/kmem/__lseek.s
lsof_4.49/dialects/linux/kmem/dfile.c
lsof_4.49/dialects/linux/kmem/dlsof.h
lsof_4.49/dialects/linux/kmem/dmnt.c
lsof_4.49/dialects/linux/kmem/dnode.c
lsof_4.49/dialects/linux/kmem/dproc.c
lsof_4.49/dialects/linux/kmem/dproto.h
lsof_4.49/dialects/linux/kmem/dsock.c
lsof_4.49/dialects/linux/kmem/dstore.c
lsof_4.49/dialects/linux/kmem/machine.h
lsof_4.49/dialects/linux/proc/
lsof_4.49/dialects/linux/proc/Makefile
lsof_4.49/dialects/linux/proc/machine.h
lsof_4.49/dialects/linux/proc/Mksrc
lsof_4.49/dialects/linux/proc/dfile.c
lsof_4.49/dialects/linux/proc/dlsof.h
lsof_4.49/dialects/linux/proc/dmnt.c
lsof_4.49/dialects/linux/proc/dnode.c
lsof_4.49/dialects/linux/proc/dproc.c
lsof_4.49/dialects/linux/proc/dproto.h
lsof_4.49/dialects/linux/proc/dsock.c
lsof_4.49/dialects/linux/proc/dstore.c
lsof_4.49/dialects/linux/proc/patches/
lsof_4.49/dialects/linux/proc/patches/net_ipx_af_ipx.c.patch
lsof_4.49/dialects/linux/proc/patches/README
lsof_4.49/dialects/n+obsd/
lsof_4.49/dialects/n+obsd/dnode.c
lsof_4.49/dialects/n+obsd/dsock.c
lsof_4.49/dialects/n+obsd/Mksrc
lsof_4.49/dialects/n+obsd/dlsof.h
lsof_4.49/dialects/n+obsd/dmnt.c
lsof_4.49/dialects/n+obsd/dproc.c
lsof_4.49/dialects/n+obsd/dstore.c
lsof_4.49/dialects/n+obsd/dnode1.c
lsof_4.49/dialects/n+obsd/machine.h
lsof_4.49/dialects/n+obsd/Makefile
lsof_4.49/dialects/n+obsd/dproto.h
lsof_4.49/dialects/du/
lsof_4.49/dialects/du/dlsof.h
lsof_4.49/dialects/du/Mksrc
lsof_4.49/dialects/du/dnode.c
lsof_4.49/dialects/du/ddev.c
lsof_4.49/dialects/du/dmnt.c
lsof_4.49/dialects/du/dproc.c
lsof_4.49/dialects/du/dstore.c
lsof_4.49/dialects/du/dproto.h
lsof_4.49/dialects/du/dsock.c
lsof_4.49/dialects/du/dfile.c
lsof_4.49/dialects/du/machine.h
lsof_4.49/dialects/du/Makefile
lsof_4.49/dialects/osr/
lsof_4.49/dialects/osr/include/
lsof_4.49/dialects/osr/include/sys/
lsof_4.49/dialects/osr/include/sys/cdefs.h
lsof_4.49/dialects/osr/include/netdb.h
lsof_4.49/dialects/osr/dproc.c
lsof_4.49/dialects/osr/Mksrc
lsof_4.49/dialects/osr/dlsof.h
lsof_4.49/dialects/osr/dmnt.c
lsof_4.49/dialects/osr/dsock.c
lsof_4.49/dialects/osr/dstore.c
lsof_4.49/dialects/osr/dfile.c
lsof_4.49/dialects/osr/dnode.c
lsof_4.49/dialects/osr/machine.h
lsof_4.49/dialects/osr/Makefile
lsof_4.49/dialects/osr/dproto.h
lsof_4.49/dialects/bsdi/
lsof_4.49/dialects/bsdi/Mksrc
lsof_4.49/dialects/bsdi/dfile.c
lsof_4.49/dialects/bsdi/Makefile
lsof_4.49/dialects/bsdi/dproc.c
lsof_4.49/dialects/bsdi/dproto.h
lsof_4.49/dialects/bsdi/dsock.c
lsof_4.49/dialects/bsdi/dstore.c
lsof_4.49/dialects/bsdi/machine.h
lsof_4.49/dialects/bsdi/dlsof.h
lsof_4.49/dialects/bsdi/dmnt.c
lsof_4.49/dialects/bsdi/dnode.c
lsof_4.49/dialects/uw/
lsof_4.49/dialects/uw/uw21/
lsof_4.49/dialects/uw/uw21/fs/
lsof_4.49/dialects/uw/uw21/fs/proc/
lsof_4.49/dialects/uw/uw21/fs/proc/prdata.h
lsof_4.49/dialects/uw/uw21/fs/proc/README
lsof_4.49/dialects/uw/uw21/fs/procfs/
lsof_4.49/dialects/uw/uw21/fs/procfs/prdata.h
lsof_4.49/dialects/uw/uw21/fs/procfs/README
lsof_4.49/dialects/uw/uw21/sys/
lsof_4.49/dialects/uw/uw21/sys/fs/
lsof_4.49/dialects/uw/uw21/sys/fs/fifonode.h
lsof_4.49/dialects/uw/uw21/sys/fs/namenode.h
lsof_4.49/dialects/uw/uw21/vm/
lsof_4.49/dialects/uw/Makefile
lsof_4.49/dialects/uw/Mksrc
lsof_4.49/dialects/uw/dfile.c
lsof_4.49/dialects/uw/dlsof.h
lsof_4.49/dialects/uw/dmnt.c
lsof_4.49/dialects/uw/dnode.c
lsof_4.49/dialects/uw/dnode1.c
lsof_4.49/dialects/uw/dnode2.c
lsof_4.49/dialects/uw/machine.h
lsof_4.49/dialects/uw/dsock.c
lsof_4.49/dialects/uw/uw7/
lsof_4.49/dialects/uw/uw7/vm/
lsof_4.49/dialects/uw/uw7/sys/
lsof_4.49/dialects/uw/uw7/sys/fs/
lsof_4.49/dialects/uw/uw7/sys/fs/namenode.h
lsof_4.49/dialects/uw/uw7/sys/fs/fifonode.h
lsof_4.49/dialects/uw/uw7/fs/
lsof_4.49/dialects/uw/uw7/fs/procfs/
lsof_4.49/dialects/uw/uw7/fs/procfs/prdata.h
lsof_4.49/dialects/uw/uw7/fs/procfs/README
lsof_4.49/dialects/uw/dstore.c
lsof_4.49/dialects/uw/dproc.c
lsof_4.49/dialects/uw/dproto.h
lsof_4.49/dialects/uw/dnode3.c
lsof_4.49/dialects/ptx/
lsof_4.49/dialects/ptx/Makefile
lsof_4.49/dialects/ptx/Mksrc
lsof_4.49/dialects/ptx/dfile.c
lsof_4.49/dialects/ptx/dlsof.h
lsof_4.49/dialects/ptx/dmnt.c
lsof_4.49/dialects/ptx/dnode.c
lsof_4.49/dialects/ptx/dproc.c
lsof_4.49/dialects/ptx/dproto.h
lsof_4.49/dialects/ptx/dsock.c
lsof_4.49/dialects/ptx/dstore.c
lsof_4.49/dialects/ptx/machine.h
lsof_4.49/dialects/ptx/dnode2.c
lsof_4.49/dialects/ptx/dnode1.c
lsof_4.49/dialects/ptx/ddev.c
lsof_4.49/dialects/pyramid/
lsof_4.49/dialects/pyramid/Mksrc
lsof_4.49/dialects/pyramid/dfile.c
lsof_4.49/dialects/pyramid/dproc.c
lsof_4.49/dialects/pyramid/dlsof.h
lsof_4.49/dialects/pyramid/dmnt.c
lsof_4.49/dialects/pyramid/dnode.c
lsof_4.49/dialects/pyramid/dnode1.c
lsof_4.49/dialects/pyramid/dnode2.c
lsof_4.49/dialects/pyramid/dsock.c
lsof_4.49/dialects/pyramid/dproto.h
lsof_4.49/dialects/pyramid/dstore.c
lsof_4.49/dialects/pyramid/machine.h
lsof_4.49/dialects/pyramid/MkKernOpts
lsof_4.49/dialects/pyramid/Makefile
lsof_4.49/dialects/pyramid/dnode3.c
lsof_4.49/arg.c
lsof_4.49/lib/
lsof_4.49/lib/cvfs.c
lsof_4.49/lib/dvch.c
lsof_4.49/lib/fino.c
lsof_4.49/lib/isfn.c
lsof_4.49/lib/lkud.c
lsof_4.49/lib/prfp.c
lsof_4.49/lib/rdev.c
lsof_4.49/lib/rmnt.c
lsof_4.49/lib/rnam.c
lsof_4.49/lib/rnch.c
lsof_4.49/lib/pdvn.c
lsof_4.49/lib/Makefile.skel
lsof_4.49/lib/rnmh.c
lsof_4.49/lib/ckkv.c
lsof_4.49/lib/ptti.c
lsof_4.49/lsof.h
lsof_4.49/lsof_fields.h
lsof_4.49/main.c
lsof_4.49/misc.c
lsof_4.49/node.c
lsof_4.49/print.c
lsof_4.49/proc.c
lsof_4.49/proto.h
lsof_4.49/scripts/
lsof_4.49/scripts/idrlogin.perl5
lsof_4.49/scripts/list_fields.awk
lsof_4.49/scripts/idrlogin.perl
lsof_4.49/scripts/00README
lsof_4.49/scripts/count_pf.perl5
lsof_4.49/scripts/watch_a_file.perl
lsof_4.49/scripts/big_brother.perl5
lsof_4.49/scripts/00MANIFEST
lsof_4.49/scripts/list_NULf.perl5
lsof_4.49/scripts/list_fields.perl
lsof_4.49/scripts/count_pf.perl
lsof_4.49/scripts/xusers.awk
lsof_4.49/scripts/identd.perl5
lsof_4.49/scripts/shared.perl5
lsof_4.49/store.c
lsof_4.49/usage.c
lsof_4.49/version
lsof_4.49/lsof.8
lsof_4.49/lsof.man
javaservice:/usr/src/lsof# cd lsof_4.49
javaservice:/usr/src/lsof/lsof_4.49# ls

total 1080
   4 00.README.FIRST    36 00QUICKSTART     4 lib/             24 proc.c
   8 00CREDITS          56 00README        96 lsof.8           12 proto.h
  32 00DCACHE           20 00XCONFIG       20 lsof.h            4 scripts/
   4 00DIALECTS          8 AFSConfig*     112 lsof.man         16 store.c
  88 00DIST             92 Configure*       8 lsof_fields.h    16 usage.c
156 00FAQ              24 Customize*      24 main.c            4 version
   4 00LSOF-L            8 Inventory*      28 misc.c
   4 00MANIFEST         40 arg.c            8 node.c
  56 00PORTING           4 dialects/       60 print.c
javaservice:/usr/src/lsof/lsof_4.49# ./Configure
No target dialect was specified.
Usage: Configure <options> <target-dialect>
  <options>:  -clean        : clean up previous configuration
              -d|-dialects  : display a list of supported dialect versions
              -h|-help      : display help information
              -n            : avoid AFS, customization, and inventory checks
  <target-dialect> (****USE -d TO GET TESTED DIALECT VERSION NUMBERS****):
    aix|aixgcc              : IBM AIX xlc (aix) or gcc (aixgcc)
    bsdi                    : BSDI BSD/OS
    decosf                  : DEC OSF/1
    digital_unix|du         : Digital UNIX
    freebsd                 : FreeBSD
    hpux|hpuxgcc            : HP-UX cc (hpux) or gcc (hpuxgcc)
    linux                   : Linux
    netbsd                  : NetBSD
    nextstep|next|ns|nxt    : NEXTSTEP
    openbsd                 : OpenBSD
    openstep|os             : OpenStep
    osr|sco                 : SCO OpenServer, SCO devloper's compiler
    osrgcc|scogcc           : SCO OpenServer, gcc compiler
    pyramid|pyr             : Pyramid DC/OSx and Reliant UNIX
    ptx                     : Sequent PTX
    solaris|solariscc       : Solaris gcc (solaris) or cc (solariscc)
    sunos|sunoscc           : SunOS gcc (sunos) or cc (sunoscc)
    tru64                   : Tru64 UNIX
    ultrix                  : Ultrix
    unixware|uw             : SCO UnixWare
javaservice:/usr/src/lsof/lsof_4.49# ./Configure linux
Testing C library type with cc ... done
The C library type is glibc, version "-DGLIBCV=201".
Configuring /proc-based Linux lsof

This configuration step (the Inventory script) takes inventory of
the lsof distribution.  The script runs for a minute or two while
it checks that all the subdirectories, information files, scripts,
header files and source files that should be present really are.

It's not absolutely necessary that you take inventory, but it's a
good idea to do it right after the lsof distribution has been
unpacked.  Once the inventory has been taken, this script creates
the file ./.ck00MAN as a signal that the inventory step has been
done.

You can call the Inventory script directly at any time to take
inventory.  You can inhibit the inventory step permanently by
creating the file ./.neverInv, and you can tell the Configure script
to skip the inventory and customization steps with the -n option.

Do you want to take inventory (y|n) [y]?

Conducting an inventory of the lsof distribution; this will take a while.

Examining /usr/src/lsof/lsof_4.49: OK
Examining dialects: OK
Examining dialects/aix: OK
Examining dialects/bsdi: OK
Examining dialects/du: OK
Examining dialects/freebsd: OK
Examining dialects/freebsd/include: OK
Examining dialects/freebsd/include/procfs: OK
Examining dialects/hpux: OK
Examining dialects/hpux/kmem: OK
Examining dialects/hpux/kmem/hpux11: OK
Examining dialects/linux: OK
Examining dialects/linux/kmem: OK
Examining dialects/linux/kmem/patches: OK
Examining dialects/linux/proc: OK
Examining dialects/linux/proc/patches: OK
Examining dialects/n+obsd: OK
Examining dialects/n+os: OK
Examining dialects/osr: OK
Examining dialects/osr/include: OK
Examining dialects/osr/include/sys: OK
Examining dialects/ptx: OK
Examining dialects/pyramid: OK
Examining dialects/sun: OK
Examining dialects/sun/include: OK
Examining dialects/sun/include/sys: OK
Examining dialects/ultrix: OK
Examining dialects/uw: OK
Examining dialects/uw/uw21: OK
Examining dialects/uw/uw21/fs: OK
Examining dialects/uw/uw21/fs/proc: OK
Examining dialects/uw/uw21/fs/procfs: OK
Examining dialects/uw/uw21/sys: OK
Examining dialects/uw/uw21/sys/fs: OK
Examining dialects/uw/uw21/vm: OK
Examining dialects/uw/uw7: OK
Examining dialects/uw/uw7/fs: OK
Examining dialects/uw/uw7/fs/procfs: OK
Examining dialects/uw/uw7/sys: OK
Examining dialects/uw/uw7/sys/fs: OK
Examining dialects/uw/uw7/vm: OK
Examining lib: OK
Examining scripts: OK

This lsof distribution seems to be complete.

rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c dstore.c kerne
lbase.h machine.h machine.h.old new_machine.h __lseek.s Makefile
ln -s dialects/linux/proc/dfile.c dfile.c
ln -s dialects/linux/proc/dlsof.h dlsof.h
ln -s dialects/linux/proc/dmnt.c dmnt.c
ln -s dialects/linux/proc/dnode.c dnode.c
ln -s dialects/linux/proc/dproc.c dproc.c
ln -s dialects/linux/proc/dproto.h dproto.h
ln -s dialects/linux/proc/dsock.c dsock.c
ln -s dialects/linux/proc/dstore.c dstore.c
ln -s dialects/linux/proc/machine.h machine.h
Makefile and lib/Makefile created.

You may now customize the machine.h header file for this UNIX
dialect.  The customizations will take effect when you compile
lsof.  You may also choose to skip customization and proceed to
the compilation of lsof.

If you don't know if you need to customize or want to know more
about what you can customize, consult the 00DCACHE, 00FAQ, 00PORTING,
and 00README files of the lsof distribution.  You might also find
it helpful to examine the machine.h header file for the dialect
you're customizing.

You don't need to use this procedure to customize lsof; you can
edit the machine.h header file directly.  If you later decide you
want to use this procedure to customize machine.h, execute the
./Customize script.

Do you want to customize (y|n) [y]?

Customizing ...

=====================================================================

When HASSECURITY is enabled, only the root user may use lsof to
examine all open files; other users may examine only the files
belonging to the real user ID of their lsof process.

When HASSECURITY is disabled, anyone may use lsof to examine all
open files.

HASSECURITY is disabled.

Enable HASSECURITY (y|n) [n]?

HASSECURITY will not be changed.

=====================================================================

When WARNINGSTATE is enabled, lsof will will issue whatever warning
messages it finds necessary.  When WARNINGSTATE is disabled, lsof
will issue no warning messages.  For individual uses of lsof, -w
disables warning state and +w enables it.

WARNINGSTATE is enabled.

Disable WARNINGSTATE? (y|n) [n]?

WARNINGSTATE will not be changed.

=====================================================================

A new machine.h file has been created in "new_machine.h".

Do you want to rename machine.h to machine.h.old and replace it with
new_machine.h (y|n) [y]?

You may now run the make command -- e.g.,

        $ make

javaservice:/usr/src/lsof/lsof_4.49#
javaservice:/usr/src/lsof/lsof_4.49# make
(cd lib; make DEBUG="-O" CFGF="-DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2
.2.12-20kr\"")
make[1]: Entering directory `/usr/src/lsof/lsof_4.49/lib'
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c ckkv.c
-o ckkv.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c cvfs.c
-o cvfs.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c dvch.c
-o dvch.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c fino.c
-o fino.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c isfn.c
-o isfn.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c lkud.c
-o lkud.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c pdvn.c
-o pdvn.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c prfp.c
-o prfp.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c ptti.c
-o ptti.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c rdev.c
-o rdev.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c rmnt.c
-o rmnt.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c rnam.c
-o rnam.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c rnch.c
-o rnch.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR="2.2.12-20kr"  -O   -c rnmh.c
-o rnmh.o
ar cr liblsof.a ckkv.o cvfs.o dvch.o fino.o isfn.o lkud.o pdvn.o prfp.o ptti.o rdev.
o rmnt.o rnam.o rnch.o rnmh.o
ranlib liblsof.a
make[1]: Leaving directory `/usr/src/lsof/lsof_4.49/lib'
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c dfi
le.c -o dfile.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c dmn
t.c -o dmnt.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c dno
de.c -o dnode.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c dpr
oc.c -o dproc.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c dso
ck.c -o dsock.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c dst
ore.c -o dstore.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c arg
.c -o arg.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c mai
n.c -o main.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c mis
c.c -o misc.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c nod
e.c -o node.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c pri
nt.c -o print.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c pro
c.c -o proc.o
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c sto
re.c -o store.o
Constructing version.h
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c usa
ge.c -o usage.o
cc -o lsof dfile.o dmnt.o dnode.o dproc.o dsock.o dstore.o arg.o main.o misc.o node.
o print.o proc.o store.o usage.o -L./lib -llsof
javaservice:/usr/src/lsof/lsof_4.49# make install
(cd lib; make DEBUG="-O" CFGF="-DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2
.2.12-20kr\"")
make[1]: Entering directory `/usr/src/lsof/lsof_4.49/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/src/lsof/lsof_4.49/lib'
Constructing version.h
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c usa
ge.c -o usage.o
cc -o lsof dfile.o dmnt.o dnode.o dproc.o dsock.o dstore.o arg.o main.o misc.o node.
o print.o proc.o store.o usage.o -L./lib -llsof

Please write your own install rule.  Lsof should be installed
setuid to root if you wish any lsof user to be able to examine
all open files.  Your install rule actions might look something
like this:

    install -m 4xxx -o root -g <group> ${PROG} ${BIN}
    install -m 444 ${MAN} ${DOC}

You will have to complete the 4xxx modes, the <group> value,
and the skeletons for the BIN and DOC strings, given at the
beginning of this Makefile, e.g.,

    BIN= ${DESTDIR}/usr/local/etc
    DOC= ${DESTDIR}/usr/man/man8
    GRP= sys

javaservice:/usr/src/lsof/lsof_4.49# ls
total 1364
   4 00.README.FIRST     8 Inventory*     0 dsock.c@          12 misc.o
   8 00CREDITS           4 Makefile      24 dsock.o            8 node.c
  32 00DCACHE           40 arg.c          0 dstore.c@          4 node.o
   4 00DIALECTS         16 arg.o          4 dstore.o          60 print.c
  88 00DIST              0 dfile.c@       4 lib/              20 print.o
156 00FAQ               4 dfile.o      104 lsof*             24 proc.c
   4 00LSOF-L            4 dialects/     96 lsof.8            12 proc.o
   4 00MANIFEST          0 dlsof.h@      20 lsof.h            12 proto.h
  56 00PORTING           0 dmnt.c@      112 lsof.man           4 scripts/
  36 00QUICKSTART        4 dmnt.o         8 lsof_fields.h     16 store.c
  56 00README            0 dnode.c@      16 machine.h          8 store.o
  20 00XCONFIG           8 dnode.o        0 machine.h.old@    16 usage.c
   8 AFSConfig*          0 dproc.c@      24 main.c            12 usage.o
  92 Configure*         12 dproc.o       16 main.o             4 version
  24 Customize*          0 dproto.h@     28 misc.c             4 version.h
javaservice:/usr/src/lsof/lsof_4.49# make install
(cd lib; make DEBUG="-O" CFGF="-DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2
.2.12-20kr\"")
make[1]: Entering directory `/usr/src/lsof/lsof_4.49/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/src/lsof/lsof_4.49/lib'
Constructing version.h
cc  -DLINUXV=22012 -DGLIBCV=201 -DHASIPv6 -DLSOF_VSTR=\"2.2.12-20kr\"    -O   -c usa
ge.c -o usage.o
cc -o lsof dfile.o dmnt.o dnode.o dproc.o dsock.o dstore.o arg.o main.o misc.o node.
o print.o proc.o store.o usage.o -L./lib -llsof

Please write your own install rule.  Lsof should be installed
setuid to root if you wish any lsof user to be able to examine
all open files.  Your install rule actions might look something
like this:

    install -m 4xxx -o root -g <group> ${PROG} ${BIN}
    install -m 444 ${MAN} ${DOC}

You will have to complete the 4xxx modes, the <group> value,
and the skeletons for the BIN and DOC strings, given at the
beginning of this Makefile, e.g.,

    BIN= ${DESTDIR}/usr/local/etc
    DOC= ${DESTDIR}/usr/man/man8
    GRP= sys

javaservice:/usr/src/lsof/lsof_4.49# install -m 4755 -o root -g root lsof /usr/local/bin
javaservice:/usr/src/lsof/lsof_4.49# mkdir /usr/local/man/man8
javaservice:/usr/src/lsof/lsof_4.49# cp lsof.8 /usr/local/man/man8/
javaservice:/usr/src/lsof/lsof_4.49#
javaservice:/usr/src/lsof/lsof_4.49#



PS: solaris 용 lsof 는 아래 문서를 참조하세요.
http://www.javaservice.net/~java/bbs/read.cgi?m=unix&b=unix&c=r_p&n=991922524

PS: AIX용 binary 파일 첨부합니다. (lsof_aix_binary.tar)
   그러나 가급적, 소스를(lsof_4.56_W.tar.gz) 다운받아 직접 컴파일하세요




:
Posted by 라면스프