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="/usr/bin/nohup"<br>VM="/home/mariano/squeak/expury/build/squeak"<br># Para produccion, como no van a estar las X, tengo que poner el -vm-display-null<br>
VM_PARAMS="-mmap 200m -vm-sound-null"<br>IMAGE="destinoMochila.image"<br>#start the vm<br>$NOHUP "$VM" $VM_PARAMS "$IMAGE" &<br># store in a file the PID of squeakVM<br>echo $! > 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"><<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>></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">>>>>> "Mariano" == Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>> writes:<br>
<br>
>> Generally, send 15 (SIGTERM), and wait a second or two, and if that<br>
>> doesn't work, send 2 (SIGINT), and if that doesn't work, send 1<br>
>> (SIGHUP). If that doesn't, REMOVE THE BINARY because the program is<br>
>> badly behaved!<br>
>><br>
<br>
</div>Mariano> 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>
<<a href="mailto:merlyn@stonehenge.com">merlyn@stonehenge.com</a>> <URL:<a href="http://www.stonehenge.com/merlyn/" target="_blank">http://www.stonehenge.com/merlyn/</a>><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>