<!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.3243" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008>Well done,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008>&nbsp;&nbsp;&nbsp; if you read the monit documentation 
you will figure out quickly how to use it. And yes you have to set a name for 
each process/image which monit only can discern by looking its pid file. That's 
why I've made those squeak production images to make a pid file with the name of 
the service (only if in unix like OS) and delete it when shutdown. And the 
script that is named with the name of the service.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008>&nbsp;&nbsp;&nbsp; I'm also using two scripts one is 
SERVICENAME and the other is SERVICENAMEg. The second is to open the image with 
full display. This can be done in the same script by a different command like 
startHeadfull instead of start and that comand uses the headfull invocation of 
squeak.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008>&nbsp;&nbsp;&nbsp; So the scripts to start and stop 
looks pretty much as those but I modify them to allow me to pass as argument a 
configuration file (just a .st file defining a dictionary of options). I think 
they will work for any linux. I needed to make a directory under /var/run to 
store only pids of seaside images to make things more 
simple.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008>&nbsp;&nbsp;&nbsp; cheers,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=875170213-07022008></SPAN></FONT>&nbsp;</DIV>
<DIV align=left><SPAN class=250542422-20122006>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=left><?xml:namespace prefix 
= st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><st1:PersonName 
ProductID="Sebastian Sastre&#13;" w:st="on"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'">Sebastian 
Sastre<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" 
/><o:p></o:p></SPAN></st1:PersonName></P></DIV></SPAN>
<DIV>&nbsp;</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>Rajeev 
  Lochan<BR><B>Enviado el:</B> Jueves, 07 de Febrero de 2008 
  10:34<BR><B>Para:</B> Seaside - general discussion<BR><B>Asunto:</B> Re: 
  [Seaside] Monit on Ubuntu / Debian to monitor Seaside 
  images<BR></FONT><BR></DIV>
  <DIV></DIV>Hi Sebastian,<BR>I am figuring out a bit of what you sent me in 
  your reply. OJ7WRE is the name of your Seaside service. I am now searching for 
  init script for Squeak image. Till now, this is the nearest things I have 
  got<BR><BR><A 
  href="http://wiki.squeak.org/swiki/124">http://wiki.squeak.org/swiki/124</A>&nbsp;&nbsp;&nbsp;&nbsp; 
  for RedHat Distro<BR><A 
  href="http://wiki.squeak.org/swiki/123">http://wiki.squeak.org/swiki/123</A>&nbsp;&nbsp;&nbsp;&nbsp; 
  for Solaris<BR><BR>Which one to go for ?, Is there any other thing much more 
  specific to Debian / Ubuntu . <BR><BR>Thanks for your help,<BR>Rajeev<BR><BR>
  <DIV class=gmail_quote>On Feb 7, 2008 2:28 AM, Sebastian Sastre &lt;<A 
  href="mailto:ssastre@seaswork.com">ssastre@seaswork.com</A>&gt; 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>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>Hi Rajeev,</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;&nbsp;&nbsp; Monit its simple and yet 
    powerful.</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;&nbsp;&nbsp; This is how the monitrc file looks like to 
    monitor a squeak image:</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>###############################################################################<BR>## 
    Monitoring DEVELOPMENT Service 
    OJ7WRE<BR>###############################################################################</SPAN></FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;check process OJ7WRE with pidfile 
    /var/run/services/OJ7WRE.pid<BR>&nbsp;group server<BR>&nbsp;start program = 
    "/etc/init.d/OJ7WRE start"<BR>&nbsp;stop program = "/etc/init.d/OJ7WRE 
    stop"</SPAN></FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;if cpu &gt; 60% for 2 cycles then alert<BR>&nbsp;if cpu 
    &gt; 80% for 5 cycles then restart<BR>&nbsp;if totalmem &gt; 200.0 MB for 2 
    cycles then restart</SPAN></FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;if loadavg(5min) greater than 10 for 8 cycles then 
    restart<BR>&nbsp;if 5 restarts within 5 cycles then 
    timeout</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>###############################################################################</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;&nbsp;&nbsp;&nbsp;the start and stop script is doing more 
    or less what you are doing manually. I send a kill -15 to close image 
    gently. Also I needed to make the pid file when the image starts and remove 
    before image quits. I have an object in the image dedicated to startup and 
    shutdown production stuff inside the image.</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;&nbsp;&nbsp; For a "more monitored" services you can make 
    monit to send you an email to your cell phone if it reach some point (like a 
    service restart or fail to start or CPU 100% for more than 5 min&nbsp;or 
    apache is down or whatever).</SPAN></FONT></DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&nbsp;&nbsp;&nbsp; cheers,</SPAN></FONT></DIV>
    <DIV><FONT face="Trebuchet MS" color=#0000ff size=2></FONT>&nbsp;</DIV>
    <DIV align=left><SPAN>
    <P style="MARGIN: 0cm 0cm 0pt" align=left><SPAN 
    style="FONT-SIZE: 10pt">Sebastian Sastre</SPAN></P>
    <P style="MARGIN: 0cm 0cm 0pt"></P>
    <P style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN lang=ES-AR 
    style="FONT-SIZE: 7.5pt; FONT-FAMILY: Verdana"></SPAN><SPAN lang=ES-AR><FONT 
    face=Verdana></FONT></SPAN></P></SPAN></DIV><BR>
    <BLOCKQUOTE 
    style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,255) 2px solid; MARGIN-RIGHT: 0px">
      <DIV lang=es dir=ltr align=left>
      <HR>
      <FONT face=Tahoma size=2><B>De:</B> <A 
      href="mailto:seaside-bounces@lists.squeakfoundation.org" 
      target=_blank>seaside-bounces@lists.squeakfoundation.org</A> [mailto:<A 
      href="mailto:seaside-bounces@lists.squeakfoundation.org" 
      target=_blank>seaside-bounces@lists.squeakfoundation.org</A>] <B>En nombre 
      de </B>Rajeev Lochan<BR><B>Enviado el:</B> Miércoles, 06 de Febrero de 
      2008 17:36<BR><B>Para:</B> Seaside - general discussion<BR><B>Asunto:</B> 
      [Seaside] Monit on Ubuntu / Debian to monitor Seaside 
      images<BR></FONT><BR></DIV>
      <DIV>
      <DIV></DIV>
      <DIV class=Wj3C7c>
      <DIV></DIV>Hi,<BR>I have been working towards setting up a dedicated 
      server (Ubuntu) to host my Seaside app as per Ramon's Blog <A 
      href="http://onsmalltalk.com/programming/smalltalk/scaling-seaside-redux-enter-the-penguin/" 
      target=_blank>http://onsmalltalk.com/programming/smalltalk/scaling-seaside-redux-enter-the-penguin/</A><BR><BR>Till 
      now, I have been successful in having Apache serve static content and Load 
      balance between 3 images of my Seaside App. Sticky sessions are working 
      and everything is going well so far. But I had a problem when installing 
      Daemontools (which Ramon has written in his blog and also Lukas has 
      written in Mailing lists), the recent versions of Ubuntu, dont support 
      Daemontools out of the box. <BR><BR>In one of the comments to Ramon's 
      post, I could learn that some of the seasiders have used Monit to do much 
      more than want Daemontools does. Could you please guide me how to go 
      about.<BR><BR>I came across a blog on Rails using Monit&nbsp; <A 
      href="http://www.igvita.com/2006/11/07/monit-makes-mongrel-play-nice/" 
      target=_blank>http://www.igvita.com/2006/11/07/monit-makes-mongrel-play-nice/</A><BR>In 
      that, what is the equivalent code to Seaside of the following code 
      ?<BR><BR><PRE><FONT size=4>start program = <SPAN style="COLOR: rgb(153,102,0)">"/usr/local/bin/ruby /usr/local/bin/mongrel_rails start -d -e production -p 8010 -a <A href="http://127.0.0.1" target=_blank>127.0.0.1</A> -P /home/user/current/log/mongrel.8010.pid -c /home/user/rails/current"</SPAN><BR>

    stop program  = <SPAN style="COLOR: rgb(153,102,0)">"/usr/local/bin/ruby /usr/local/bin/mongrel_rails stop -P /home/user/current/log/mongrel.8010.pid"</SPAN></FONT></PRE>Till 
      now, I have been starting the images manually by <BR>/seaside$ 
      squeakvm&nbsp; -nodisplay seasidedemo "" port 9090 &amp;<BR><BR>and to 
      kill it, i use $ pkill squeakvm&nbsp;&nbsp;&nbsp; or $ kill [PID of 
      SqueakVM]<BR><BR>I suppose, we will also have to change the following 
      code<BR><PRE><FONT size=4><SPAN style="FONT-WEIGHT: bold; COLOR: rgb(153,102,204)">if</SPAN> totalmem is greater than <SPAN style="COLOR: rgb(0,102,102)">60.0</SPAN> MB <SPAN style="FONT-WEIGHT: bold; COLOR: rgb(153,102,204)">for</SPAN> <SPAN style="COLOR: rgb(0,102,102)">5</SPAN> cycles <SPAN style="FONT-WEIGHT: bold; COLOR: rgb(153,102,204)">then</SPAN> restart<BR>

<BR></FONT></PRE>When an image is running on my server (Pentium Dual Core 
      2.8 GHz with 1 GB RAM), it shows almost 3-4% CPU and 3-4% RAM , should we 
      shift the memory cap from 60 MB to 100 MB / image ?<BR><BR><BR>Is there 
      any other options we have ? <BR><BR>Thanks for the 
      help,<BR>&nbsp;<BR>Rajeev <BR><BR>Co-founder, AR-CAD.com<BR><BR><A 
      href="http://www.ar-cad.com" 
      target=_blank>http://www.ar-cad.com</A><BR>+91 9243468076 
      (Bangalore)<BR>080 65355873 
    </DIV></DIV></BLOCKQUOTE></DIV><BR>_______________________________________________<BR>seaside 
    mailing list<BR><A 
    href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</A><BR><A 
    href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" 
    target=_blank>http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</A><BR><BR></BLOCKQUOTE></DIV><BR><BR 
  clear=all><BR>-- <BR>Rajeev Lochan<BR><BR>Co-founder, AR-CAD.com<BR><BR><A 
  href="http://www.ar-cad.com">http://www.ar-cad.com</A><BR>+91 9243468076 
  (Bangalore)<BR>080 65355873 </BLOCKQUOTE></BODY></HTML>