Thanks to all of you. Now I have these 2 beautiful scripts:<br><br>startMyApp.sh:<br><br><br>#!/bin/sh<br>#settings<br>NOHUP=&quot;/usr/bin/nohup&quot;<br>VM=&quot;/home/mariano/squeak/expury/build/squeak&quot;<br># Para produccion, como no van a estar las X, tengo que poner el -vm-display-null<br>
VM_PARAMS=&quot;-mmap 200m -vm-sound-null&quot;<br>IMAGE=&quot;destinoMochila.image&quot;<br>#start the vm<br>$NOHUP &quot;$VM&quot; $VM_PARAMS &quot;$IMAGE&quot; &amp;<br># store in a file the PID of squeakVM<br>echo $! &gt; evince.pid<br>
<br><br>stopMyApp.sh:<br><br>#!/bin/bash<br>PID=`cat evince.pid`<br>kill -15 $PID || exit 0<br>sleep 2<br>kill -2 $PID || exit 0<br>sleep 2<br>kill -1 $PID || exit 0<br>sleep 2<br>kill -9 $PID || exit 0<br><br><br>Thanks for the help!<br>
<br>Mariano<br><br><br><br><div class="gmail_quote">On Sun, Jul 26, 2009 at 7:58 PM, Randal L. Schwartz <span dir="ltr">&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">&gt;&gt;&gt;&gt;&gt; &quot;Mariano&quot; == Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; writes:<br>
<br>
&gt;&gt; Generally, send 15 (SIGTERM), and wait a second or two, and if that<br>
&gt;&gt; doesn&#39;t work, send 2 (SIGINT), and if that doesn&#39;t work, send 1<br>
&gt;&gt; (SIGHUP).  If that doesn&#39;t, REMOVE THE BINARY because the program is<br>
&gt;&gt; badly behaved!<br>
&gt;&gt;<br>
<br>
</div>Mariano&gt; Ok.....but how can I do this from a script ?<br>
<br>
kill -15 $PID || exit 0<br>
sleep 2<br>
kill -2 $PID || exit 0<br>
sleep 2<br>
kill -1 $PID || exit 0<br>
sleep 2<br>
kill -9 $PID || exit 0<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095<br>
&lt;<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>&gt; &lt;URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>&gt;<br>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.<br>
See <a href="http://methodsandmessages.vox.com/" target="_blank">http://methodsandmessages.vox.com/</a> for Smalltalk and Seaside discussion<br>
</div></div></blockquote></div><br>