<?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: kill parent and its child process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060234#M436596</link>
    <description>It appears if you aren't in the same process group, you must specify each PID.&lt;BR /&gt;&lt;BR /&gt;Also, you should be very leery of using kill -9.&lt;BR /&gt;&lt;BR /&gt;One way to get the PIDs of a tree is to use:&lt;BR /&gt;$ UNIX95= ps -Hfu user&lt;BR /&gt;&lt;BR /&gt;Then you can cut &amp;amp; paste a PID and PPID in one step.  Move up 2 lines and cut 2 more.</description>
    <pubDate>Fri, 27 Jul 2007 06:28:52 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-07-27T06:28:52Z</dc:date>
    <item>
      <title>kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060233#M436595</link>
      <description>I am working on HP-UX 11.23 Integrity server. I would like to know the command which will help to kill the parent process as well as the child process of the parent. Kill -9 &lt;PID&gt; kills only the parent process and not its child process.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;Senthil.&lt;/PID&gt;</description>
      <pubDate>Fri, 27 Jul 2007 05:41:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060233#M436595</guid>
      <dc:creator>prakasse</dc:creator>
      <dc:date>2007-07-27T05:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060234#M436596</link>
      <description>It appears if you aren't in the same process group, you must specify each PID.&lt;BR /&gt;&lt;BR /&gt;Also, you should be very leery of using kill -9.&lt;BR /&gt;&lt;BR /&gt;One way to get the PIDs of a tree is to use:&lt;BR /&gt;$ UNIX95= ps -Hfu user&lt;BR /&gt;&lt;BR /&gt;Then you can cut &amp;amp; paste a PID and PPID in one step.  Move up 2 lines and cut 2 more.</description>
      <pubDate>Fri, 27 Jul 2007 06:28:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060234#M436596</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-27T06:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060235#M436597</link>
      <description>&lt;!--!*#--&gt;It isn't even a good idea to reap the parent that way because you make the child an orphan.&lt;BR /&gt;You will either have to parse all the pids that have the same ppid (i.e. are children of the same parent).&lt;BR /&gt;e.g. &lt;BR /&gt;$ UNIX95= ps -C sshd -o pid= -o ppid=         &lt;BR /&gt;  990     1&lt;BR /&gt;13403   990&lt;BR /&gt;13405 13403&lt;BR /&gt; 2671  2669&lt;BR /&gt; 2669   990&lt;BR /&gt;&lt;BR /&gt;Here 2669 and 13403 are both children of sshd pid 990.&lt;BR /&gt;&lt;BR /&gt;An alternative, kill several birds with one stone, would be if they all belong to the same process group.&lt;BR /&gt;Then it is sufficient to only signal the pgid with a prepended minus sign.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -g 2241 -o pid,ppid,pgid,comm   &lt;BR /&gt;  PID  PPID  PGID COMMAND&lt;BR /&gt; 2244  2242  2241 oninit&lt;BR /&gt; 2241     1  2241 oninit&lt;BR /&gt; 2245  2242  2241 oninit&lt;BR /&gt; 2242  2241  2241 oninit&lt;BR /&gt; 2243  2242  2241 oninit&lt;BR /&gt; 2246  2242  2241 oninit&lt;BR /&gt; 2247  2242  2241 oninit&lt;BR /&gt; 2248  2242  2241 oninit&lt;BR /&gt; 2249  2242  2241 oninit&lt;BR /&gt; 2250  2242  2241 oninit&lt;BR /&gt;&lt;BR /&gt;Here we have several Informix processes that all belong to the same pgid 2241.&lt;BR /&gt;Then you could kill -s TERM -2241&lt;BR /&gt;(note you must specify the signal explicitly in that case or prepend -- to indicate that the following minus sign does not indicate an option)&lt;BR /&gt;However, one should never finish the database that way.&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Jul 2007 07:13:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060235#M436597</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2007-07-27T07:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060236#M436598</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Process=$1&lt;BR /&gt;plist=$Process&lt;BR /&gt;ps -ef|grep $Process|grep -v grep&lt;BR /&gt;ps -ef|while read a b c rest&lt;BR /&gt;do&lt;BR /&gt;  if [ "$c" = "$Process" ]&lt;BR /&gt;  then&lt;BR /&gt;     plist=$plist" "$b&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;echo kill -9 $plist&lt;BR /&gt;&lt;BR /&gt;If you like the output . Just use the command printed.&lt;BR /&gt;&lt;BR /&gt;This is all good input but as indicated dangerous so dry run a few tests before making a command which just kills&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;       Steve Steel</description>
      <pubDate>Fri, 27 Jul 2007 07:32:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060236#M436598</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2007-07-27T07:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060237#M436599</link>
      <description>Hi,&lt;BR /&gt;I use the attached scripts killkids to kill all the childs of a process including a process itself (-s).&lt;BR /&gt;It run on hpux11i from years.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Mon, 30 Jul 2007 03:25:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060237#M436599</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-07-30T03:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060238#M436600</link>
      <description>Hi,&lt;BR /&gt;this is the script (pidtree) used by the previous script.&lt;BR /&gt;Surely both can be improved. Please, in case someone improve them sent me a copy.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;</description>
      <pubDate>Mon, 30 Jul 2007 03:26:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060238#M436600</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-07-30T03:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: kill parent and its child process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060239#M436601</link>
      <description>I have found a solution to this question as seen in the comments below</description>
      <pubDate>Mon, 30 Jul 2007 04:54:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kill-parent-and-its-child-process/m-p/5060239#M436601</guid>
      <dc:creator>prakasse</dc:creator>
      <dc:date>2007-07-30T04:54:13Z</dc:date>
    </item>
  </channel>
</rss>

