[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



Here is sample:

  $pids{$pid}{'name'} = $name;
  $pids{$pid}{'pid'} = $pid;
  $pids{$pid}{'cmd'}  = $cmd;
  $pids{$pid}{'args'} = @args;

This is part of an init.d program that stays running to make sure that
some programs never terminate.  If they do it will be responsible for
logging an error and then restarting that proggie.  It will keep Java
RMI program running.

Child Handler:

    if($CHILD == 1) {
      my $child_pid = wait;
      my $status = $?;
      foreach my $ref (sort keys %pids) {
        if($child_pid == $ref) {
          print "Process $pids{$ref}{'name'} exited!\n";
          print "  CMD: $pids{$ref}{'cmd'} $pids{$ref}{'args'}\n";
        }
      }
      $CHILD = 0;
    }



Thanks,
Chris



</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00991" href="msg00991.html">[ale] attaching an array to a hash</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00986.html">[ale] New Topic</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00988.html">[ale] New Topic</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00990.html">[ale] New Topic</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00991.html">[ale] attaching an array to a hash</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00987"><strong>Date</strong></a></li>
<li><a href="threads.html#00987"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>