- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Find PID's
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
08-15-2005 09:08 PM
08-15-2005 09:08 PM
Find PID's
Sometimes due to some errors i have to terminate that script.
Now comes the main part, how do I do that?
I can see the individual compilations via
ps -ef | grep compiler
and also kill them via
kill -9 pid
But the scirpt continues:
How do i find out which is the master script which gave birth to all these sub-processes.
This can't be a single step of seeing the PPID in the ps, as its a 3-4 step parent-child process.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 09:30 PM
08-15-2005 09:30 PM
Re: Find PID's
For example if I have a shell and run a long find command, then from another shell I do ps -g
$ ps -g 4068
PID TTY TIME COMMAND
4068 pts/17 0:00 sh
12200 pts/17 0:00 find
If this doesn't work for you, and you have control over the scripts that run your compiles, you could have them all output their PID to a file in /var/run, and then you can kill the entire list if required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 09:37 PM
08-15-2005 09:37 PM
Re: Find PID's
Please remember to cancel the child before the parent!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 09:41 PM
08-15-2005 09:41 PM
Re: Find PID's
But i can't backtrack as the tree goes to 4-5 steps.
Further by the time i start traversing the tree some of the child process completes giving me an illegal PID.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 09:50 PM
08-15-2005 09:50 PM
Re: Find PID's
Example:
Process x has ppid 1234
find process with pid 1234, which will give you PPID 2345
repeat until PPID is 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 09:57 PM
08-15-2005 09:57 PM
Re: Find PID's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 10:01 PM
08-15-2005 10:01 PM
Re: Find PID's
How do i get the PID of the process group leader.
This is what i am trying to find out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 10:08 PM
08-15-2005 10:08 PM
Re: Find PID's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2005 10:13 PM
08-15-2005 10:13 PM
Re: Find PID's
We simply run it from the command prompt.
I thought of giving the name of script and grep but it won't work as sometimes we don't know the name of script as the running person is a different one.
Don't tell me to ask that person the script name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2005 05:35 PM
08-16-2005 05:35 PM
Re: Find PID's
$ UNIX95= ps -p
Then you can find PIDs of all processes assocated with this session with
$ UNIX95= ps -o pid= -g
To put it all together (untested)
$ kill -2 $(UNIX95= ps -o pid= -g $(UNIX95= ps -p