<?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: Find PID's in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604427#M233418</link>
    <description>Dump the output of the ps -ef command to a file to geta frozen status, then use that file to trace the PID and PPID.&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;Process x has ppid 1234&lt;BR /&gt;find process with pid 1234, which will give you PPID 2345&lt;BR /&gt;repeat until PPID is 1&lt;BR /&gt;</description>
    <pubDate>Tue, 16 Aug 2005 04:50:23 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2005-08-16T04:50:23Z</dc:date>
    <item>
      <title>Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604423#M233414</link>
      <description>I have a script which spawns multiple compilations.&lt;BR /&gt;&lt;BR /&gt;Sometimes due to some errors i have to terminate that script.&lt;BR /&gt;Now comes the main part, how do I do that?&lt;BR /&gt;&lt;BR /&gt;I can see the individual compilations via&lt;BR /&gt;ps -ef | grep compiler&lt;BR /&gt;and also kill them via&lt;BR /&gt;kill -9 pid&lt;BR /&gt;&lt;BR /&gt;But the scirpt continues:&lt;BR /&gt;&lt;BR /&gt;How do i find out which is the master script which gave birth to all these sub-processes.&lt;BR /&gt;This can't be a single step of seeing the PPID in the ps, as its a 3-4 step parent-child process.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Aug 2005 04:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604423#M233414</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T04:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604424#M233415</link>
      <description>Depending how your child processes are called, you can use "ps -g PID".  Assuming PID is the process group leader.&lt;BR /&gt;&lt;BR /&gt;For example if I have a shell and run a long find command, then from another shell I do ps -g &lt;PID of="" shell=""&gt; I get: -&lt;BR /&gt;&lt;BR /&gt;$ ps -g 4068&lt;BR /&gt;   PID TTY       TIME COMMAND&lt;BR /&gt;  4068 pts/17    0:00 sh&lt;BR /&gt; 12200 pts/17    0:00 find&lt;BR /&gt;&lt;BR /&gt;If this doesn't work for you, and you have control over the scripts that run your compiles, you could have them all output their PID to a file in /var/run, and then you can kill the entire list if required.&lt;/PID&gt;</description>
      <pubDate>Tue, 16 Aug 2005 04:30:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604424#M233415</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-08-16T04:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604425#M233416</link>
      <description>You have to track back via the PPID of one of the compile processes.&lt;BR /&gt;Please remember to cancel the child before the parent!&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Aug 2005 04:37:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604425#M233416</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-08-16T04:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604426#M233417</link>
      <description>Thanks Simon and Peter.&lt;BR /&gt;&lt;BR /&gt;But i can't backtrack as the tree goes to 4-5 steps.&lt;BR /&gt;Further by the time i start traversing the tree some of the child process completes giving me an illegal PID.</description>
      <pubDate>Tue, 16 Aug 2005 04:41:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604426#M233417</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T04:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604427#M233418</link>
      <description>Dump the output of the ps -ef command to a file to geta frozen status, then use that file to trace the PID and PPID.&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;Process x has ppid 1234&lt;BR /&gt;find process with pid 1234, which will give you PPID 2345&lt;BR /&gt;repeat until PPID is 1&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Aug 2005 04:50:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604427#M233418</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-08-16T04:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604428#M233419</link>
      <description>If i have to do this, then i will say let the script do whatever it wants to do and i will start all over again.&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Aug 2005 04:57:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604428#M233419</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T04:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604429#M233420</link>
      <description>Simon,&lt;BR /&gt;&lt;BR /&gt;How do i get the PID of the process group leader.&lt;BR /&gt;&lt;BR /&gt;This is what i am trying to find out.</description>
      <pubDate>Tue, 16 Aug 2005 05:01:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604429#M233420</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T05:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604430#M233421</link>
      <description>How you determine this will depend on how you run your script.  If it runs from cron you can check the cron log for the PID.  Otherwise ps and grep for "compile_script.sh" or whatever is the "master" script, and this will be your group leader.</description>
      <pubDate>Tue, 16 Aug 2005 05:08:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604430#M233421</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-08-16T05:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604431#M233422</link>
      <description>No,&lt;BR /&gt;&lt;BR /&gt;We simply run it from the command prompt.&lt;BR /&gt;I thought of giving the name of script and grep but it won't work as sometimes we don't know the name of script as the running person is a different one.&lt;BR /&gt;&lt;BR /&gt;Don't tell me to ask that person the script name.</description>
      <pubDate>Tue, 16 Aug 2005 05:13:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604431#M233422</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-08-16T05:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Find PID's</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604432#M233423</link>
      <description>Given a process ID (e.g. your compiler) you can find process group ID with&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -p &lt;PID&gt; -o pgid=&lt;BR /&gt;&lt;BR /&gt;Then you can find PIDs of all processes assocated with this session with&lt;BR /&gt;&lt;BR /&gt;$ UNIX95= ps -o pid= -g &lt;PGID&gt;&lt;BR /&gt;&lt;BR /&gt;To put it all together (untested)&lt;BR /&gt;&lt;BR /&gt;$ kill -2 $(UNIX95= ps -o pid= -g $(UNIX95= ps -p &lt;PID&gt; -o pgid))&lt;/PID&gt;&lt;/PGID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 17 Aug 2005 00:35:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-pid-s/m-p/3604432#M233423</guid>
      <dc:creator>Ermin Borovac</dc:creator>
      <dc:date>2005-08-17T00:35:47Z</dc:date>
    </item>
  </channel>
</rss>

