script to restart an image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

script to restart an image

Nicolas Roard
Hi,

This little bash script might be useful to some:

#!/bin/bash

NAME=pier_backup

VM_PATH=/var/www/pier
OPTIONS="-vm-display-X11 -headless -vm-sound-null -mmap 64m"
VM="$VM_PATH/vm/pharo-vm-0.15.2d-linux/squeak $OPTIONS"

LOOKUP="$NAME*.image"
ls $VM_PATH/$LOOKUP -t1 | while read fn
do
TEST=`ps ax | grep squeak | grep -c $NAME`
if [ $TEST == 0 ]
then
        echo "RESTART VM $fn"
        $VM $fn &
fi
exit
done

Stick it in your crontab, and it will automatically restart squeak if
somehow it died, using the last backup pier created (image
persistency)

--
Nicolas Roard
"I love deadlines. I like the whooshing sound
they make as they fly by." -- Douglas Adams
_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki