[Seaside] How to start an image with PORT parameter
Miguel Enrique Cobá Martinez
miguel.coba at gmail.com
Sun Jul 26 21:08:50 UTC 2009
El dom, 26-07-2009 a las 17:54 -0300, Mariano Martinez Peck escribió:
>
>
> On Sun, Jul 26, 2009 at 5:25 PM, Philippe Marschall
> <philippe.marschall at gmail.com> wrote:
> 2009/7/26 Mariano Martinez Peck <marianopeck at gmail.com>:
>
> >
> >
> > 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?
>
>
> Write the pid into a file?
>
> I am still newbie with *nix. How can I know the PID from a process I
> started from nohup? Suppose I have this script:
>
In a script or a unix shell, you, after executing a command, can use
$! to obtain the PID of the last process and $? to obtain the exit code
of the process. Then you can use this variables to form the name of a
file or to store it on a file to subsecuent use, like killing the
process later. e.g
miguel at laptop:~$ evince &
[1] 13500
miguel at laptop:~$ echo $!
13500
miguel at laptop:~$ echo $?
0
miguel at laptop:~$ echo $! > evince.pid
miguel at laptop:~$ cat evince.pid
13500
miguel at laptop:~$ man kill
miguel at laptop:~$ kill -9 `cat evince.pid `
miguel at laptop:~$
that are backticks around the cat command.
Cheers,
Miguel Cobá
> #!/bin/sh
> #settings
> NOHUP="/usr/bin/nohup"
> VM="/home/mariano/squeak/expury/build/squeak"
> # Para produccion, como no van a estar las X, tengo que poner el
> -vm-display-null
> VM_PARAMS="-mmap 200m -vm-sound-null"
> IMAGE="destinoMochila.image"
>
> #start the vm
> $NOHUP "$VM" $VM_PARAMS "$IMAGE" &
>
>
> And I want to add a line/s at the end of this script that writes to a
> file called "destinoMochilaPID" the PID of that SqueakVM. How can I do
> this ?
>
> Thanks for the help!
>
> Mariano
>
>
>
>
> 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
More information about the seaside
mailing list