<!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=359485601-09022008>Very good,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; I think we can give a number count 
in the name of the process. Lets say</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideService1.1&nbsp; in port 
101001</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideService1.2&nbsp; in port 
101002</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideService1.3&nbsp; in port 
101003</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideService2.1 in port 
102001</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideService2.2&nbsp; in port 
102002</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; </SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideServiceN.1 in port 
10N001</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; ...</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; seasideServiceN.M in port 
10N00M</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; for an automatic&nbsp;installation 
of a service&nbsp;some script factory will be needed but is very easy to make 
once we have the script to start stop images. Just writting the template script 
with customized process name port and path.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp;&nbsp;I've not worked yet on the 
balancer part but I think we can use HAProxy as Ramon's blog says making it to 
balance load using the rigth set of services.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008>&nbsp;&nbsp;&nbsp; 
cheers,</SPAN></FONT></SPAN></FONT></DIV></DIV>
<DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff size=2><SPAN 
class=359485601-09022008></SPAN></FONT>&nbsp;</DIV></SPAN></FONT></DIV></SPAN></FONT></SPAN></FONT></SPAN></FONT></SPAN></FONT></SPAN></FONT></DIV></DIV></DIV></DIV></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>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Trebuchet MS'"><o:p>&nbsp;</o:p></SPAN></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> Viernes, 08 de Febrero de 2008 
  17:00<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>Thanks for your kind help Sebastian.<BR>Following your 
  instructions, I have managed to write init script for start and stop. I was 
  lucky to get code from <A 
  href="http://www.nabble.com/attachment/8445249/1/squeak_http_service">http://www.nabble.com/attachment/8445249/1/squeak_http_service</A><BR><BR>and 
  after some tweaking, I have the following code for 
  /etc/init.d/seaside<BR><BR>#########################################################################<BR>#!/bin/sh<BR><BR># 
  Script to start a Squeak(Seaside) Image which runs Kom HTTP Server in 
  -nodisplay mode.<BR># Because main purpose is to run as service from 
  /etc/init.d/seaside,<BR># this can be started by root, but runs under regular 
  user<BR><BR># Check and run what user asked for.<BR><BR>case "$1" 
  in<BR>&nbsp;&nbsp;&nbsp; 
  start)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo -n "Starting 
  Seaside "<BR>&nbsp;&nbsp;&nbsp; if [ "$SQUEAK_HTTP_PID" != "" ]; 
  then<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; echo "SQUEAK_HTTP Already running, 
  exiting"<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; # exit 1<BR>&nbsp;&nbsp;&nbsp; 
  else<BR><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; # Change directory and run Squeak 
  headless<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; cd 
  /home/rajeev/caartz<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /usr/bin/squeakvm 
  -nodisplay caartz01 "" port 9091 
  &amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  SQUEAK_HTTP_PID=`ps -eo pid,command | grep "squeak" | grep -v grep | awk '{ 
  print $1 }'`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  cd /var/run<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; echo 
  "Seaside is Started and is running with 
  PID"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 
  $SQUEAK_HTTP_PID<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  echo $SQUEAK_HTTP_PID &gt; 
  squeak.pid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  fi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<BR>&nbsp;&nbsp;&nbsp; 
  stop)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo -n "Shutting 
  down Seaside "<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  cd /var/run&nbsp;&nbsp;&nbsp;&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQUEAK_HTTP_PID=`head 
  squeak.pid` <BR>&nbsp;&nbsp;&nbsp; if [ "$SQUEAK_HTTP_PID" = "" ]; 
  then<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; echo "Seaside Not 
  running!"<BR>&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; #kill 
  -SIGINT $SQUEAK_HTTP_PID<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; kill -HUP 
  $SQUEAK_HTTP_PID<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  rm -rf squeak.pid<BR>&nbsp;&nbsp;&nbsp; 
  fi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<BR>&nbsp;&nbsp;&nbsp; 
  pid)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd 
  /var/run<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SQUEAK_HTTP_PID=`head 
  squeak.pid` <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp; echo "You asked for PID: here:"<BR>&nbsp;&nbsp;&nbsp; 
  echo $SQUEAK_HTTP_PID&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; 
  ;;<BR>&nbsp;&nbsp;&nbsp; *)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 
  "Usage: $0 {start|stop|pid}"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  exit 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  ;;<BR>esac<BR><BR><BR>##########################################################################<BR><BR>I 
  then add the following code in monitrc<BR><BR><FONT face="Trebuchet MS" 
  color=#0000ff size=2><SPAN>check process squeakvm with pidfile 
  /var/run/squeak.pid<BR>&nbsp;group server<BR>&nbsp;start program = 
  "/etc/init.d/seaside start"<BR>&nbsp;stop program = "/etc/init.d/seaside 
  stop"</SPAN></FONT> 
  <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>#####################################################################<BR><BR>And 
  to my excitement, Monit works for the above set of code.<BR>1) I am able to 
  start a seaside image, grep for 'squeak' in the ps and assign its PID to a 
  variable and then echo that into /var/run/squeak.pid&nbsp;&nbsp; (here 
  squeak.pid is created or overwritten)<BR><BR>2) When I stop the image, the PID 
  is read from /var/run/squeak.pid and the process is killed, then the file 
  squeak.pid is deleted<BR><BR>The setup works well. I did the following to 
  test<BR><BR>$ pkill squeakvm&nbsp; <BR>or<BR>$ sudo /etc/init.d/seaside 
  stop<BR><BR>In both cases, after daemon checking time of 60 seconds, Seaside 
  image was started automatically.<BR><BR>So far so good, now my only concern in 
  this regard is how to run Multiple seaside/squeak images ?<BR><BR>AFAIK, the 
  default process name for all the squeak instances running are 'squeakvm' , how 
  to change this to suit image name or the best thing would be to have 
  seaside_9091&nbsp; (port number.. the way mongrel_8010 is named)<BR><BR>If we 
  get unique process name, then using Monit would become easier.<BR><BR>Thanks 
  &amp; Regards,<BR>Rajeev<BR><BR>
  <DIV class=gmail_quote>On Feb 7, 2008 6:46 PM, 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>Well done,</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; 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></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&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></SPAN></FONT>&nbsp;</DIV>
    <DIV dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN>&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></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 dir=ltr align=left><FONT face="Trebuchet MS" color=#0000ff 
    size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV align=left><SPAN>
    <P style="MARGIN: 0cm 0cm 0pt" align=left><SPAN 
    style="FONT-SIZE: 10pt">Sebastian Sastre</SPAN></P></SPAN></DIV>
    <DIV>&nbsp;</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>
      <DIV class=Ih2E3d><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></DIV><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></DIV>
      <DIV class=Wj3C7c>
      <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" 
      target=_blank>http://wiki.squeak.org/swiki/124</A>&nbsp;&nbsp;&nbsp;&nbsp; 
      for RedHat Distro<BR><A href="http://wiki.squeak.org/swiki/123" 
      target=_blank>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" 
      target=_blank>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>
          <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" 
        target=_blank>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" 
      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>