- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File Descriptors
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 05:37 AM
тАО03-19-2002 05:37 AM
File Descriptors
Thanks for any help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 05:44 AM
тАО03-19-2002 05:44 AM
Re: File Descriptors
get a copy of lsof:
http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.61/
and use it to find your process and open files from within your script.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 06:49 AM
тАО03-19-2002 06:49 AM
Re: File Descriptors
Ciao
Federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 07:04 AM
тАО03-19-2002 07:04 AM
Re: File Descriptors
server# /opt/lsof/bin/lsof -p 531
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
syslogd 531 root cwd VDIR 64,0x3 1024 2 /
syslogd 531 root txt VREG 64,0x7 36864 20338 /usr (/dev/vg00/lvol7)
syslogd 531 root mem VREG 64,0x7 40960 109 /usr/lib/libnss_files.1
syslogd 531 root mem VREG 64,0x7 20480 20348 /usr/lib/libdld.2
syslogd 531 root mem VREG 64,0x7 1552384 18166 /usr/lib/libc.2
syslogd 531 root mem VREG 64,0x7 126976 20346 /usr/lib/dld.sl
syslogd 531 root 0r VDIR 64,0x3 1024 2 /
syslogd 531 root 1r VDIR 64,0x3 1024 2 /
syslogd 531 root 2r VDIR 64,0x3 1024 2 /
syslogd 531 root 3r FIFO 64,0x3 0t2048 1246 / (/dev/vg00/lvol3) rd=0x800
syslogd 531 root 4w FIFO 64,0x3 0t2048 1246 / (/dev/vg00/lvol3) wr=0x800
syslogd 531 root 5u unix 0x30b5300 0t0 /dev/log.un
syslogd 531 root 6u inet 0x30ace40 0t0 UDP *:syslog (Idle)
syslogd 531 root 7r VCHR 189,0 0t2246 931 /dev/klog
syslogd 531 root 9w VREG 64,0x8 4009 529 /var/adm/syslog/mail.log
syslogd 531 root 10w VREG 64,0x8 44621 990 /var/adm/syslog/syslog.log
syslogd 531 root 11w VCHR 0,0 0t0 67 /dev/console
GL,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 07:19 AM
тАО03-19-2002 07:19 AM
Re: File Descriptors
code sniplet for KSH using lsof:
WHOAMI=$$
#
# note: 0u=tty, 1u=stdout, 2u=stderr
# also tr is used to remove all extra spaces,
# TWO SPACES in first pair of quotes, then
# ONE SPACE in second pair of quotes
#
WHATisSTDTTY=`/usr/local/bin/lsof -p $WHOAMI|grep " 0u "|tr -s " " " "|cut -d"
" -f9`
WHATisSTDOUT=`/usr/local/bin/lsof -p $WHOAMI|grep " 1u "|tr -s " " " "|cut -d"
" -f9`
WHATisSTDERR=`/usr/local/bin/lsof -p $WHOAMI|grep " 2u "|tr -s " " " "|cut -d"
" -f9`
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 07:38 AM
тАО03-19-2002 07:38 AM
Re: File Descriptors
Can't think of another way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 07:49 AM
тАО03-19-2002 07:49 AM
Re: File Descriptors
THIS is from the HP PORTING site, and is just like "perl", "emacs", "gzip/gunzip", "CIFS/9000 (samba)", "netscape browser", "apache", "JAVA", "ssh", "SSL", "vi", "awk", "sed", and about a thousand+ other things that HP doesn't write or OWN. THEY PORTED it!
My company had the same LAME policy, until I explained the ABOVE to them!
Without OPEN SOURCE, unix would be DEAD and we'd all be running M$ crap everywhere!
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2002 09:07 AM
тАО03-19-2002 09:07 AM
Re: File Descriptors
Not as flexible as lsof, because you have to know the pid first.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2002 04:10 AM
тАО03-22-2002 04:10 AM
Re: File Descriptors
Yes indeed glance gives it. I haven't given up on lsof because it might be easier to make part of a script.
I haven't used glance much, I can't see a way of using this within a script though (I can easily get the pid), it only seems to work interactively.
The search contiues...