- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Killing parent pid
Operating System - HP-UX
1755691
Members
3332
Online
108837
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО09-17-2009 01:04 PM
тАО09-17-2009 01:04 PM
Re: Killing parent pid
Hi Srini:
> ...replace echo with kill
And while we are on the subject of killing processes, don't use 'kill -9' without first attempting a simple 'kill' first.
A 'kill -9' cannot be caught and thus a process has no (programatic) chance to cleanup temporary files and/or shared memory segments.
Instead, escalate your annihilation:
kill -TERM ${mypid} > /dev/null 2>&1
sleep 2
kill -HUP ${mypid} > /dev/null 2>&1
sleep 2
kill -9 ${mypid} > /dev/null 2>&1
If the first 'kill' works ${mypid} will no longer be valid and the second (and third) 'kill's will be no-ops. If the 'kill -9' fails to terminate the process then it is waiting on an I/O to complete or in some other kernel state for which it can't be interrupted.
Regards!
...JRF...
> ...replace echo with kill
And while we are on the subject of killing processes, don't use 'kill -9' without first attempting a simple 'kill' first.
A 'kill -9' cannot be caught and thus a process has no (programatic) chance to cleanup temporary files and/or shared memory segments.
Instead, escalate your annihilation:
kill -TERM ${mypid} > /dev/null 2>&1
sleep 2
kill -HUP ${mypid} > /dev/null 2>&1
sleep 2
kill -9 ${mypid} > /dev/null 2>&1
If the first 'kill' works ${mypid} will no longer be valid and the second (and third) 'kill's will be no-ops. If the 'kill -9' fails to terminate the process then it is waiting on an I/O to complete or in some other kernel state for which it can't be interrupted.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-17-2009 01:08 PM
тАО09-17-2009 01:08 PM
Re: Killing parent pid
Srinikalyan,
>Is there any script to find all the child processes if we give the input as the parent pid?
Which version of OS you are using.
If you are on 11.31 use , ptree , it is a very nice program. It prints the complete process tree hierarchy.
http://docs.hp.com/en/B2355-60130/ptree.1.html
Cheers,
Raj.
>Is there any script to find all the child processes if we give the input as the parent pid?
Which version of OS you are using.
If you are on 11.31 use , ptree , it is a very nice program. It prints the complete process tree hierarchy.
http://docs.hp.com/en/B2355-60130/ptree.1.html
Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-18-2009 01:08 AM
тАО09-18-2009 01:08 AM
Re: Killing parent pid
>Bill: grep -- -u Be sure to use two dashes (grep --) to terminate the option processing and treat "-u" as a simple string.
Using "--" is overkill and not as flexible as just "-e -u". After -e, you can add more options.
>do NOT grep for pid or ppid!!! This will find critical processes that happen to have matching numbers in the run string.
My grep pattern anchored it to the PPID.
Using "--" is overkill and not as flexible as just "-e -u". After -e, you can add more options.
>do NOT grep for pid or ppid!!! This will find critical processes that happen to have matching numbers in the run string.
My grep pattern anchored it to the PPID.
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP