- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Does a process have an open file handle?
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
Forums
Discussions
Discussions
Discussions
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
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
06-25-2005 08:17 AM
06-25-2005 08:17 AM
I'm trying to write a script to clean up some logfiles, but I need to be certain no active processes have an open filehandle. I thought I could do this easily using lsof ("lsof filename" should list any processing using the file), but the command just coredumps on my 11i server. I got the lsof package from the HPUX porting site, for the 11.0 and 11i OS's. Does someone know of a different lsof I should use, or have another solution to my problem?
Thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 08:30 AM
06-25-2005 08:30 AM
Re: Does a process have an open file handle?
11i as in 11.11 or 11.23 ?
Could you post a uname -a
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 08:39 AM
06-25-2005 08:39 AM
Re: Does a process have an open file handle?
cfcert1:/opt/fcrtv3/log #> uname -a
HP-UX cfcert1 B.11.11 U 9000/800 122901577 unlimited-user license
cfcert1:/opt/fcrtv3/log #> swlist | grep -i lsof
lsof 4.74 lsof
cfcert1:/usr/local/bin #> chatr lsof
chatr(warning): dl_header_ext.size != sizeof(dl_header_ext). Please update your
version of the chatr tool.
lsof:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path disabled second Not Defined
shared library list:
dynamic /usr/lib/libnsl.1
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
third quadrant global data space disabled
data page size: D (default)
instruction page size: D (default)
nulptr references enabled
shared library private mapping disabled
shared library text merging disabled
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 09:00 AM
06-25-2005 09:00 AM
Re: Does a process have an open file handle?
lsof Run-time dependencies: bison flex gcc gettext libiconv m4
Attached a older 64 bits version to this thread should work on your 11.11 version.
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 09:12 AM
06-25-2005 09:12 AM
Re: Does a process have an open file handle?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 09:12 AM
06-25-2005 09:12 AM
Re: Does a process have an open file handle?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 09:18 AM
06-25-2005 09:18 AM
Re: Does a process have an open file handle?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 09:31 AM
06-25-2005 09:31 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 09:37 AM
06-25-2005 09:37 AM
Re: Does a process have an open file handle?
lsof | grep filename
note: give a filename not a full directory path.
also:
lsof > /tmp/lsof.out
grep filename /tmp/lsof.out
then you can run awk or cut tools on this file to get the pid.. and then you can status the pid -- to see if it is still running..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2005 11:55 AM
06-25-2005 11:55 AM
Re: Does a process have an open file handle?
Can you try using fuser in your script if you are still facing problems with lsof
Cheers!!!
eknath