lsof: can't figure out how to show open files

From: Sippel, Christian (Christian.Sippel_at_IZB.DE)
Date: 05/24/05

  • Next message: Green, Simon: "Re: lsof: can't figure out how to show open files"
    Date:         Tue, 24 May 2005 14:21:58 +0200
    To: aix-l@Princeton.EDU
    
    

    Dear list,
    I'd like to see what files a process is accessing. When using lsof (version
    4.61 from the Linux toolbox) on an AIX 5.2 ML5 machine it shows me the
    filesystems the open files are in but not the actual files, for example

    :> ps -ef | grep syslog
        root 17598 18132 0 Apr 27 - 0:05 /usr/sbin/syslogd
        root 41858 46080 1 14:19:55 pts/5 0:00 grep syslog
    :> lsof -p 17598
    lsof: WARNING: compiled for AIX version 5.1.0.0; this is 5.2.0.0.
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    syslogd 17598 root cwd VDIR 10,4 21474918848 0 / (/dev/hd4)
    syslogd 17598 root 0r VDIR 10,4 85899559405 0 / (/dev/hd4)
    syslogd 17598 root 1r VDIR 10,4 85899559405 0 / (/dev/hd4)
    syslogd 17598 root 2r VDIR 10,4 85899559405 0 / (/dev/hd4)
    syslogd 17598 root 3u unix NFS,65535 0t0 0 /dev/log
    syslogd 17598 root 4u IPv4 0x72099100 0t0 UDP *:syslog
    syslogd 17598 root 6w VREG 10,18 4295131556 0 /var/adm/log
    (/dev/varadmlog)
    syslogd 17598 root 13u unix NFS,65535 0t0 0
    /dev/.SRC-unix/SRCdwrJqa

    Same thing on a Linux box works the way I want it:

    # ps -ef | grep syslog
    root 584 1 0 2004 ? 00:00:16 syslogd -m 0
    root 7723 7627 0 14:11 pts/2 00:00:00 grep syslog
    # lsof -p 584
    COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
    syslogd 584 root cwd DIR 104,2 4096 2 /
    syslogd 584 root rtd DIR 104,2 4096 2 /
    syslogd 584 root txt REG 104,2 26972 33413 /sbin/syslogd
    syslogd 584 root mem REG 104,2 485171 507982 /lib/ld-2.2.4.so
    syslogd 584 root mem REG 104,2 5772268 32864
    /lib/i686/libc-2.2.4.so
    syslogd 584 root mem REG 104,2 261460 508016
    /lib/libnss_files-2.2.4.so
    syslogd 584 root 0u unix 0xf66d75a0 838 /dev/log
    syslogd 584 root 2w REG 104,5 486 98382 /var/log/messages
    syslogd 584 root 3w REG 104,5 362 98355 /var/log/secure
    syslogd 584 root 4w REG 104,5 0 98380 /var/log/maillog
    syslogd 584 root 5w REG 104,5 4969 98350 /var/log/cron
    syslogd 584 root 6w REG 104,5 0 98357 /var/log/spooler
    syslogd 584 root 7w REG 104,5 0 98365 /var/log/boot.log
    #

    I know in UNIX everything is a file ;-) but: Can someone point me to the
    right usage of lsof in AIX?

    Thanks,
    Christian


  • Next message: Green, Simon: "Re: lsof: can't figure out how to show open files"

    Relevant Pages