[Seaside] How to start an image with PORT parameter

Miguel Enrique Cobá Martinez miguel.coba at gmail.com
Sun Jul 26 20:48:58 UTC 2009


El dom, 26-07-2009 a las 17:03 -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
> 
> 
> Sorry for the offtopic, what I have a question: is there a simple way
> to kill what you started with nohup?

Are you meaning to kill a given process started with nohup in
unix/linux? You must search its PID and kill that pid with kill PID or,
as Philippe said.

> I mean, I have a similar script to yours called "startApp.sh" but I
> want to do another called "stopApp.sh".
If you are using the script passed to the image on start up that I
posted the other time, you can, in a forked process inside the image to
constantly search for a file in a given path. When found, you call
snapshot on the image and quit. This way, you start the image without
the file on the path and when you need to shut them down, you create an
empty file on the path, the images notice it and shuts down. You can
even give each image a different file name to search for and stop the
images independently.

> The only way I saw to do this is to do a killall squeak but I don't
> know...what happens if I have more than one vm/image ?
> 

killall kills all the process named some form. If you have several
processes for example of firefox, a killall firefox will kill all of
them.

Cheers,
Miguel Cobá
> Thanks,
> 
> Mariano
> 
> 
>  
>         port $PORT >> $LOGS_HOME/seaside.nohup &
>         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