- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Identify processes launched from a directory
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
05-26-2009 05:17 AM
05-26-2009 05:17 AM
Identify processes launched from a directory
I am writing a script that kills processes that were launched from a directory or a sub-directory of it.
I need to identify the processes to be killed.
I am doing that on machines with HP-UX 11.x. I know that lsof could help me but I am not sure it is installed on every machine.
Is there another way to do that ?
Thanks to any help
Jose
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 05:23 AM
05-26-2009 05:23 AM
Re: Identify processes launched from a directory
Maybe with fuser ?
but lsof would be a better choice.
regards,
Cedrick Gaillard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 05:42 AM
05-26-2009 05:42 AM
Re: Identify processes launched from a directory
ps -efx shows full command names. you can grep from the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 05:48 AM
05-26-2009 05:48 AM
Re: Identify processes launched from a directory
I know fuser but I can't see how to use it for my problem. Fuser list processes using a file but not processes launched from a known directory.
Jose
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 05:51 AM
05-26-2009 05:51 AM
Re: Identify processes launched from a directory
Ps -efx is ok if processes are launched with full pathnames.
But how to deal with people doing that :
cd toto; ./truc
Jose
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 06:09 AM
05-26-2009 06:09 AM
Re: Identify processes launched from a directory
you could identify executable commands in the directory and fuser them:
fuser -u /usr/sbin/fuser
/usr/sbin/fuser: 6976t(root)
a little bit ugly but it will work.
Regards,
Cerick Gaillard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2009 06:22 AM
05-26-2009 06:22 AM
Re: Identify processes launched from a directory
Yes, a bit ugly but it should work.
I'll do that.
Many thanks
Jose