- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: related process
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
тАО12-13-2007 01:38 AM
тАО12-13-2007 01:38 AM
Re: related process
Sorry to my stupid , the below script is OK , but I still have question , the psid is only child process of pid , so from the below result , $3 is the pid ( 31694)
the script :
or psid in `cat /tmp/process.list`
do
for psids in `ps -ef | grep $psid | awk '{ print $2, $3 }'`
do
kill -9 $psids
done
done
the result
31697 31694
1548 29714
but what I want to kill is ppid , I can find it by ps -ef | grep 31694 | awk '{ print $2, $3 }'` , this $3 is the ppid , if I want to kill this $3 , can advise how can I change the script ? Thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 01:43 AM
тАО12-13-2007 01:43 AM
Re: related process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 01:56 AM
тАО12-13-2007 01:56 AM
Re: related process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 02:35 AM
тАО12-13-2007 02:35 AM
Re: related process
You're going to have to have a picture. You need to explain why you think your script doesn't work.
Your script will kill the list of PIDs. And it will also kill their children and their parent.
It does that by first finding PID in PID field, and then killing both PID and PPID. If it finds in in the PPID field, it kills child and the PID again. (I assumed you didn't care that you killed some twice.)
So since I think it does what you want, you will need to explain what's missing by an example.
Note: should really be using my for/UNIX95= ps solution that correctly "greps" and even Bill will be happy. :-)
Basically use my script and that xargs checking script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 04:30 AM
тАО12-13-2007 04:30 AM
Re: related process
You're going to have to have a picture. You need to explain why you think your script doesn't work.
--> the reason is the /tmp/process.list , the process id (58245,55874,5842,58745) in this file is not a pid , I can use the script to find the pid , and now want to have another script to find the ppid , the /tmp/process.list is generated from the another script .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 04:38 AM
тАО12-13-2007 04:38 AM
Re: related process
PIDs are PIDs. :-)
>now want to have another script to find the ppid
To find a list of PPIDs for each PID in that file:
for pid in $(< /tmp/process.list); do
UNIX95= ps -p $pid -o ppid=
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 05:04 PM
тАО12-13-2007 05:04 PM
Re: related process
Your script can find the ppid , it is OK.
for pid in $(< /tmp/process.list); do
UNIX95= ps -p $pid -o ppid=
done
But if I want to find the parent id of this ppid , can advise what can i do ? thx
ps. what I actucally want is the parent id of ppid in the /tmp/process.list .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 06:33 PM
тАО12-13-2007 06:33 PM
Re: related process
>what I actually want is the parent id of ppid in the /tmp/process.list.
The file just has PIDs. I find the PPID of each PID in that file.
If you really want to go back one more:
for pid in $(< /tmp/process.list); do
UNIX95= ps -p $(UNIX95= ps -p $pid -o ppid=) -o ppid=
done
- « Previous
-
- 1
- 2
- Next »