<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3562" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=046280212-28072009><FONT face="Trebuchet MS"
color=#0000ff size=2>Now you have a PID for the image you can even monitor and
program reactions (like restarting a service) if something goes wrong with it
(no PID, not opening connections in a port, etc).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046280212-28072009><FONT face="Trebuchet MS"
color=#0000ff size=2>Monit can do that for you (<A
href="http://mmonit.com/monit/">http://mmonit.com/monit/</A>).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046280212-28072009><FONT face="Trebuchet MS"
color=#0000ff size=2>cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=046280212-28072009><FONT face="Trebuchet MS"
color=#0000ff size=2>sebastian</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=es dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> seaside-bounces@lists.squeakfoundation.org
[mailto:seaside-bounces@lists.squeakfoundation.org] <B>En nombre de
</B>Mariano Martinez Peck<BR><B>Enviado el:</B> Sunday, July 26, 2009
20:12<BR><B>Para:</B> Randal L. Schwartz<BR><B>CC:</B> Seaside - general
discussion<BR><B>Asunto:</B> Re: [Seaside] How to start an image with PORT
parameter<BR></FONT><BR></DIV>
<DIV></DIV>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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<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></BLOCKQUOTE></BODY></HTML>