<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing ppid values and zombies in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883018#M400895</link>
    <description>When the Parent dies and the child lives, then Social Security kicks in and the Government (PID = 1) dictates who the child is to report to.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
    <pubDate>Mon, 31 Jan 2005 08:53:43 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2005-01-31T08:53:43Z</dc:date>
    <item>
      <title>Changing ppid values and zombies</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883017#M400894</link>
      <description>I have encountered a situation I previously thought impossible, that is ppid value for pid changes during life of pid.&lt;BR /&gt;&lt;BR /&gt;I have written a korn shell script that runs on...&lt;BR /&gt;&lt;BR /&gt;$ uname -a&lt;BR /&gt;HP-UX hqetlsu1 B.11.11 U 9000/800 12842844 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;The script kills zombie processes id by the following rules;&lt;BR /&gt;- Data is obtained by command ps –ef as root to a file.&lt;BR /&gt;- Process is owned by btbbatch &amp;amp;&lt;BR /&gt;- Process name is phantom w/ arg DSD.StageRun &amp;amp;&lt;BR /&gt;- Process' parent pid is 1&lt;BR /&gt;&lt;BR /&gt;Developers are reporting that my script is killing legitimate pids. &lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;Ps –ef data from killer script at 21:46 system time...&lt;BR /&gt;2005/01/28 21:46:22 - KILLED - btbbatch 14366 1 234 21:39:44 ? 4:01 phantom DSD.StageRun jbBTBCreateAcctXrefWithFirm. jbBTBCreateAc&lt;BR /&gt;&lt;BR /&gt;Ps –ef data from screen capture at 21:52 system time...&lt;BR /&gt;$ date&lt;BR /&gt;Fri Jan 28 21:52:16 EST 2005&lt;BR /&gt;$ ps -ef | grep 14366&lt;BR /&gt;btbbatch 14366 14335 255 21:39:44 ?   9:08 phantom DSD.StageRun jbBTBCreateAcctXrefWithFirm. jbBTBCreateAc&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I thought that a ppid was static for the life of a pid.  But my data is showing different. &lt;BR /&gt;&lt;BR /&gt;How is the ppid value changing?&lt;BR /&gt;How do I check for true zombies in this situation?&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Jan 2005 08:18:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883017#M400894</guid>
      <dc:creator>Chris O'Neal</dc:creator>
      <dc:date>2005-01-31T08:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Changing ppid values and zombies</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883018#M400895</link>
      <description>When the Parent dies and the child lives, then Social Security kicks in and the Government (PID = 1) dictates who the child is to report to.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Mon, 31 Jan 2005 08:53:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883018#M400895</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-01-31T08:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Changing ppid values and zombies</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883019#M400896</link>
      <description>First of all, trying to kill a zombie process is utterly pointless; the processes, by definition, are already dead and in any event can certainly no longer respond to a signal. Moreover, the only resource consumed by a zombie is a slot in the process table so there's no real harm unless you have so many that the kernel's process table is full. The only time that the ppid can change after the fork() that created a process is when the parent process dies. It that case, the orphaned processes are assigned to init (pid 1).</description>
      <pubDate>Mon, 31 Jan 2005 11:30:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883019#M400896</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-01-31T11:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Changing ppid values and zombies</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883020#M400897</link>
      <description>Well, all is still well with the world.&lt;BR /&gt;&lt;BR /&gt;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. &lt;BR /&gt;&lt;BR /&gt;The script problem was discovered when data feed was changed from a pipe from ps -ef to a file made by ps -ef.&lt;BR /&gt; &lt;BR /&gt;The typo was in an awk select statement having $3 = 1 instead of $3 == 1.&lt;BR /&gt;&lt;BR /&gt;Sample test....&lt;BR /&gt;&lt;BR /&gt;$ cat data&lt;BR /&gt;A 1 1&lt;BR /&gt;B 2 1&lt;BR /&gt;C 3 3&lt;BR /&gt;D 4 4&lt;BR /&gt;&lt;BR /&gt;$ awk '$3 = 1 { print $0 }' data&lt;BR /&gt;A 1 1&lt;BR /&gt;B 2 1&lt;BR /&gt;C 3 1&lt;BR /&gt;D 4 1&lt;BR /&gt;&lt;BR /&gt;$ awk '$3 == 1 { print $0 }' data&lt;BR /&gt;A 1 1&lt;BR /&gt;B 2 1&lt;BR /&gt;&lt;BR /&gt;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;&lt;BR /&gt;&lt;BR /&gt;"$VAR1"  =  "$VAR2"&lt;BR /&gt;&lt;BR /&gt;In awk scripts, it is;&lt;BR /&gt;&lt;BR /&gt;"$VAR1"  ==  "$VAR2"&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;The link below has info about spawn child processes and their problems (start reading at page 50)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.web-insights.net/env_audit/environments.pdf" target="_blank"&gt;http://www.web-insights.net/env_audit/environments.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;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â  .&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.erlenstar.demon.co.uk/unix/faq_2.html" target="_blank"&gt;http://www.erlenstar.demon.co.uk/unix/faq_2.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The link below has a simple explanation of "zombie" and recommends use of waitpid() over wait().&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www-h.eng.cam.ac.uk/help/tpl/unix/fork.html" target="_blank"&gt;http://www-h.eng.cam.ac.uk/help/tpl/unix/fork.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The link below has a flow diagram showing the seven-state logical process model a unix pid can be, which includes zombie.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/node16.html" target="_blank"&gt;http://www.cim.mcgill.ca/~franco/OpSys-304-427/lecture-notes/node16.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The link below explains the relationship between defunct and zombie.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.webmasterworld.com/forum40/1032.htm" target="_blank"&gt;http://www.webmasterworld.com/forum40/1032.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Sorry for the false alarm.  I feel bad about this.&lt;BR /&gt;&lt;BR /&gt;Than</description>
      <pubDate>Mon, 07 Feb 2005 11:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883020#M400897</guid>
      <dc:creator>Chris O'Neal</dc:creator>
      <dc:date>2005-02-07T11:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Changing ppid values and zombies</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883021#M400898</link>
      <description>See my posting above.  Thank you all.</description>
      <pubDate>Mon, 07 Feb 2005 11:09:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/changing-ppid-values-and-zombies/m-p/4883021#M400898</guid>
      <dc:creator>Chris O'Neal</dc:creator>
      <dc:date>2005-02-07T11:09:12Z</dc:date>
    </item>
  </channel>
</rss>

