DISCLOSURE: A Windows guy is about to offer a Linux suggestion. The suggestion may be stupid, crazy, weird or wrong or some combination of the above.

Now that we've moved past the disclaimer, here's my thoughts. If you have the process ID for script B, wouldn't it be possible to use the Linux command pkill with the -P option to kill script B and all of it's child processes? If that does work, I would think that it should be trivial calling that from script A.

From the man page on pkill's -P option: Only match processes whose parent process ID is listed.

Being that I primarily work in the Windows environment, I'm not sure if what I'm suggesting even makes sense, but thought that I'd toss it out in case I'm miraculously correct. Of course, I suspect that I might be overlooking something.


In reply to Re: Stopping subprocesses by dasgar
in thread Stopping subprocesses by James Board

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.