- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Changing ppid values and zombies
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
01-31-2005 12:18 AM
01-31-2005 12:18 AM
Changing ppid values and zombies
I have written a korn shell script that runs on...
$ uname -a
HP-UX hqetlsu1 B.11.11 U 9000/800 12842844 unlimited-user license
The script kills zombie processes id by the following rules;
- Data is obtained by command ps –ef as root to a file.
- Process is owned by btbbatch &
- Process name is phantom w/ arg DSD.StageRun &
- Process' parent pid is 1
Developers are reporting that my script is killing legitimate pids.
After commenting out the call to the kill command within the script and running a second script collecting ps –ef data 5 minutes after the killer script, I have obtained data showing that the ppid on some of the processes goes from 1 to a legitimate value.
Ps –ef data from killer script at 21:46 system time...
2005/01/28 21:46:22 - KILLED - btbbatch 14366 1 234 21:39:44 ? 4:01 phantom DSD.StageRun jbBTBCreateAcctXrefWithFirm. jbBTBCreateAc
Ps –ef data from screen capture at 21:52 system time...
$ date
Fri Jan 28 21:52:16 EST 2005
$ ps -ef | grep 14366
btbbatch 14366 14335 255 21:39:44 ? 9:08 phantom DSD.StageRun jbBTBCreateAcctXrefWithFirm. jbBTBCreateAc
You can see from the above that pid 14366 started at 21:39 changed ppid from 1 @ 21:46 to ppid of 14335 @ 21:52. I know that pid 14366 is for the same process in both of these outputs because both listings have the same process start time of 21:36:44.
I thought that a ppid was static for the life of a pid. But my data is showing different.
How is the ppid value changing?
How do I check for true zombies in this situation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 12:53 AM
01-31-2005 12:53 AM
Re: Changing ppid values and zombies
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2005 03:30 AM
01-31-2005 03:30 AM
Re: Changing ppid values and zombies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2005 03:07 AM
02-07-2005 03:07 AM
Re: Changing ppid values and zombies
I am embarrassed, but my problem of ppid changing to a value of 1 and then back to another valid value turned out to be false data caused by an error in my script.
The script problem was discovered when data feed was changed from a pipe from ps -ef to a file made by ps -ef.
The typo was in an awk select statement having $3 = 1 instead of $3 == 1.
Sample test....
$ cat data
A 1 1
B 2 1
C 3 3
D 4 4
$ awk '$3 = 1 { print $0 }' data
A 1 1
B 2 1
C 3 1
D 4 1
$ awk '$3 == 1 { print $0 }' data
A 1 1
B 2 1
My mind did not switch from korn shell syntax to awk syntax like it normally does. In korn scripts, to test if two string vars have the same values the syntax is;
"$VAR1" = "$VAR2"
In awk scripts, it is;
"$VAR1" == "$VAR2"
And I did not know that in awk you can change a data value in the input data before it is computed. I had expected that if I had bad/wrong syntax in the awk selection statement it would produced a script crash with a syntax error message. But instead I learned that awk can manipulate your raw input data in the data selection statement itself before it even gets to your code logic between the { } for that selection.
While I was trying to trouble shoot this problem as an OS issue between pid and ppid, I found the following info on the web which I was good reading and might be helpful to others.
The link below has info about spawn child processes and their problems (start reading at page 50)
http://www.web-insights.net/env_audit/environments.pdf
The link below (section 1.5, 1.6, 1.15, 1.16) has info on pid and ppids in as handled by programs. It helped me form questions to ask the vendor had the issue been OS related. Recommends use of ps â efl to check values found in column â Fâ .
http://www.erlenstar.demon.co.uk/unix/faq_2.html
The link below has a simple explanation of "zombie" and recommends use of waitpid() over wait().
http://www-h.eng.cam.ac.uk/help/tpl/unix/fork.html
The link below has a flow diagram showing the seven-state logical process model a unix pid can be, which includes zombie.
http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/node16.html
The link below explains the relationship between defunct and zombie.
http://www.webmasterworld.com/forum40/1032.htm
Sorry for the false alarm. I feel bad about this.
Than
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2005 03:09 AM
02-07-2005 03:09 AM