<div dir="ltr">Hi, <div><br></div><div>thanks Jack for that, I&#39;ve already seen this solution on the list, </div><div style>but I need to know when the pd subprocess ends and with a &#39;&amp;&#39; i get a &#39;0&#39; on [shell] rightmost outlet when &#39;echo pid $1&#39; command ends and not when pd ends</div>

<div style>moreover when killing Pd the external&#39;s destroy() method isn&#39;t called and this could block some hardware (like cameras...)</div><div style><br></div><div>but maybe I was not clear enough since I have several questions in one thread...</div>

<div style>the problem was to exit all shell subprocess when quitting pd</div><div style><br></div><div style>I solved it thanks to Cyrille by adding a watchdog</div><div style>the main pd send a &quot;ping&quot; each 100ms to all children, if there is no &quot;ping&quot; during 1 second, the child kill itself</div>

<div style>so the main pd can quit safely</div><div style><br></div><div style>king regards </div><div style><br></div><div style>antoine</div><div><br></div><div class="gmail_extra"><div>--<br>do it yourself                       <br>

<a href="http://antoine.villeret.free.fr" target="_blank">http://antoine.villeret.free.fr</a><br></div>
<br><br><div class="gmail_quote">2013/5/28 Jack <span dir="ltr">&lt;<a href="mailto:jack@rybn.org" target="_blank">jack@rybn.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Le 28/05/2013 20:14, Antoine Villeret a
      écrit :<br>
    </div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">hi, 
        <div><br>
        </div>
        <div>I&#39;m calling a new instance of Pd inside a Pd patch with
          [shell]</div>
        <div>but I notice I can&#39;t quit the main pd instance if a process
          is still running inside the [shell]</div>
        <div><br>
        </div>
        <div>the GUI hangs until the process ends (until I quit Pd)</div>
        <div>since the child pd is running without gui, </div>
        <div><br>
        </div>
        <div>1) is it possible to exit a running process via [shell] ?</div>
        <div>for example how could I send a ^c (ctrl+c) command ?</div>
        <div><br>
        </div>
        <div>2) moreover, how to trig it when I press ctrl+Q or menu
          quit ?</div>
        <div><br>
        </div>
        <div>3) the [noquit] abstraction gives me a tcl error : &quot;can&#39;t
          rename menu_quit command doesn&#39;t exists&quot;</div>
        <div><br>
        </div>
        <div>I&#39;m running pd vanilla 0.44-2</div>
        <div><br>
        </div>
        <div>thanks for help</div>
        <div><br>
        </div>
        <div>antoine</div>
        <div><br>
        </div>
        <div>
          <div>--<br>
            do it yourself                       <br>
            <a href="http://antoine.villeret.free.fr" target="_blank">http://antoine.villeret.free.fr</a><br>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
<a href="mailto:Pd-list@iem.at" target="_blank">Pd-list@iem.at</a> mailing list
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a>
</pre>
    </blockquote>
    Hello Antoine,<br>
    <br>
    With the message [pd &amp; echo $!( to [shell], you should get the
    PID of the subprocess. A [kill number_PID( to [shell] should kill
    this subprocess.<br>
    ++<span class="HOEnZb"><font color="#888888"><br>
    <br>
    Jack<br>
    <br>
    <br>
  </font></span></div>

<br>_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
<br></blockquote></div><br></div></div>