[Seaside] How to start an image with PORT parameter

Miguel Enrique Cobá Martinez miguel.coba at gmail.com
Thu Jul 16 00:33:06 UTC 2009


El mié, 15-07-2009 a las 21:20 -0300, Mariano Martinez Peck escribió:
> 
> 
> 2009/7/15 Miguel Enrique Cobá Martinez <miguel.coba at gmail.com>
>         El mié, 15-07-2009 a las 17:57 -0300, Germán Arduino escribió:
>         > Tried, but don't works.
>         >
>         > I got the same error.
>         >
>         
>         
>         I use this script to start a magma image an serveral seaside
>         images:
>         
>         #!/bin/sh
>         
>         NOHUP="/usr/bin/nohup"
>         SQUEAK_VM="/usr/bin/squeakvm"
>         SQUEAK_OPTS="-mmap 100m -vm-sound-null -vm-display-X11
>         -headless"
>         SQUEAK="$SQUEAK_VM $SQUEAK_OPTS"
>         IMAGES_HOME="/home/miguel/squeak/images/azteca"
>         SCRIPTS_HOME="/home/miguel/squeak/scripts/azteca"
>         LOGS_HOME="/home/miguel/squeak/logs/azteca"
>         START_PORT=8080
>         END_PORT=8093
>         
>         
>         # Start the Magma image
>         echo "Starting Magma image"
>         $NOHUP $SQUEAK $IMAGES_HOME/magma.image $SCRIPTS_HOME/magma.st
>         >>
>         $LOGS_HOME/magma.nohup &
>         
>         # Start the Seaside images
>         for PORT in `seq $START_PORT $END_PORT`; do
>          echo "Starting Seaside image on port: $port"
>          $NOHUP $SQUEAK $IMAGES_HOME/seaside.image
>         $SCRIPTS_HOME/seaside.st
> 
> Nice script!!!  I will base my future ones on this :)
> 
> What I don't understand here is which type of scripts you send as
> parameters to squeakVM. Scripts to the VM ?? Can you show me some
> examples of  what you have in $SCRIPTS_HOME/seaside.st ??
> 

Yes you can have here anything that you can put in a workspace.
I learned this from Ramon Leon, in the post about scaling seaside with
apache, but in the end I didn't use (I mean the seaside scaling à la
dabbledb/ramonleon) because I used lighttpd and a fixed set of images:

This is my seaside.st, again, stolen from Ramon's blog (thanks Ramon :)
[
  [
    [ 60 seconds asDelay wait.
      (FileDirectory default fileOrDirectoryExists:
'/home/miguel/proyectos/azteca/scripts/shutdown.seaside')
        ifTrue: [ SmalltalkImage current snapshot: false andQuit: true ]
    ] on: Error do: [ :error | error asDebugEmail ]
  ] repeat
] forkAt: Processor systemBackgroundPriority.
Project uiProcess suspend.

and what it does is to check every 60 seconds for the existance of a
file and if exists, just shutdown without saving. This way I can stop my
farm of seaside images. Enjoy.

> 
>         port $PORT >> $LOGS_HOME/seaside.nohup &
> 
> What does this line do?
> 

I start the images with the command nohup from unix/linux that makes a
process to continue living even if you logout the session (otherwise all
your jobs/proccess are killed on logout because are children of the
session process). The command it is everything after the nohup. The &
puts the proccess in background and the >> redirects the output (errors)
to a file for later reviewing.

> Thanks!
> 
> Mariano
>  

Saludos,
Miguel Cobá

>         
>         done
>         
>         
>         check the order of the parameters that stablish the port for
>         the seaside
>         image.
>         
>         
>         > Cheers.
>         > Germán.
>         >
>         > 2009/7/15, Philippe Marschall
>         <philippe.marschall at gmail.com>:
>         > > 2009/7/14, Germán Arduino <garduino at gmail.com>:
>         > >
>         > > > Hi:
>         > >  >
>         > >  > As far as I saw on some doc it's possible to start a
>         seaside image in
>         > >  > the way: "squeakvm seaside.image PORT nnnn". Then, as
>         WAKom check this
>         > >  > parameter on its #startUp method, is posible to have it
>         running on the
>         > >  > passed port.
>         > >
>         > >
>         > > Try:
>         > >
>         > >
>         > >  squeakvm seaside.image -- PORT nnnn
>         > >
>         > >
>         > > Squeak is a bit peculiar when it comes to command line
>         arguments.
>         > >
>         > >  Cheers
>         > >  Philippe
>         > >  _______________________________________________
>         > >  seaside mailing list
>         > >  seaside at lists.squeakfoundation.org
>         > >
>          http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>         > >
>         > _______________________________________________
>         > seaside mailing list
>         > seaside at lists.squeakfoundation.org
>         >
>         http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>         
>         _______________________________________________
>         seaside mailing list
>         seaside at lists.squeakfoundation.org
>         http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>         
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the seaside mailing list