<?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: How to check processes from a PERL program? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-check-processes-from-a-perl-program/m-p/3257061#M888019</link>
    <description>When you fork(), you should capture the PID of each child process. Then to determine is the process is still running, one easy method&lt;BR /&gt;is&lt;BR /&gt;$rslt = kill 0,$child_pid;&lt;BR /&gt;if ($rslt)&lt;BR /&gt;  {&lt;BR /&gt;    print "Child ",$child_pid," is still running.\n";&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;Signal handling is easy too:&lt;BR /&gt;&lt;BR /&gt;sub child_process&lt;BR /&gt;{&lt;BR /&gt;  print "Child sent signal\n"&lt;BR /&gt;  return(-1)&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$SIG{TERM} = \&amp;amp;child_process;&lt;BR /&gt;&lt;BR /&gt;Now if the child sends a SIGTERM to the parent pid the parent can act on it.&lt;BR /&gt;</description>
    <pubDate>Thu, 22 Apr 2004 16:38:05 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-04-22T16:38:05Z</dc:date>
    <item>
      <title>How to check processes from a PERL program?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-check-processes-from-a-perl-program/m-p/3257060#M888018</link>
      <description>Hello colleagues,&lt;BR /&gt;I'm new to PERL (even if I'm 41)&lt;BR /&gt;then I need some help to do my 1st program.&lt;BR /&gt;In my PERL program I fork several children, and I want to keep them under control, i.e. I want to know if they are still running at a certain moment.&lt;BR /&gt;I want to be as much efficient as possible.&lt;BR /&gt;I'd like to avoid "system" or ' ' calls.&lt;BR /&gt;Is there any PERL call to check a process PID?&lt;BR /&gt;Or can I receive a signal when a child dies?&lt;BR /&gt;&lt;BR /&gt;thanks for any help&lt;BR /&gt;Enrico</description>
      <pubDate>Thu, 22 Apr 2004 16:26:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-check-processes-from-a-perl-program/m-p/3257060#M888018</guid>
      <dc:creator>Enrico Venturi</dc:creator>
      <dc:date>2004-04-22T16:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to check processes from a PERL program?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-check-processes-from-a-perl-program/m-p/3257061#M888019</link>
      <description>When you fork(), you should capture the PID of each child process. Then to determine is the process is still running, one easy method&lt;BR /&gt;is&lt;BR /&gt;$rslt = kill 0,$child_pid;&lt;BR /&gt;if ($rslt)&lt;BR /&gt;  {&lt;BR /&gt;    print "Child ",$child_pid," is still running.\n";&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;Signal handling is easy too:&lt;BR /&gt;&lt;BR /&gt;sub child_process&lt;BR /&gt;{&lt;BR /&gt;  print "Child sent signal\n"&lt;BR /&gt;  return(-1)&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$SIG{TERM} = \&amp;amp;child_process;&lt;BR /&gt;&lt;BR /&gt;Now if the child sends a SIGTERM to the parent pid the parent can act on it.&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Apr 2004 16:38:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-check-processes-from-a-perl-program/m-p/3257061#M888019</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-04-22T16:38:05Z</dc:date>
    </item>
  </channel>
</rss>

