Thank you, thank you Michael, David, and Bert...works great and makes sense
as well.

Now, I am sorry to say, I will impose on you again...

I'm having problems wrapping my head around the scripts for auto-restart in
case of swiki crash (the scripts I am refering to are from the Swiki
FAQ--pasted below); I never feel comfortable using something unless I know
why it does what it does. While I haven't yet needed such scripts, I am
about to go to an unwired part of Greece for a month; the Swiki has to stay
live without my direct intervention. Can someone give me a dummies tutorial
on the how and why of setting these up (or your own favorite script)?

Thanks again,

John

**FROM SWIKI FAQ**
How can I make a swiki server reboot automatically whenever it crashes?
(I assume you not really mean to reboot the machine but to restart the
server)

First write a script that repeatedly starts the swiki:

#! /bin/sh
while true ; do squeakcomanche swiki.image ; done

This assumes you rename your VM to squeakcomanche which is usefull because
it stands out in the process list. Then write another script that checks if
it is still responding and kills it eventually:

#! /bin/sh
wget -q -O /dev/null -T 20 http://localhost:8080/ || killall squeakcomanche

This sets the timeout to 20 seconds. Then you put this script into a cron
job or make it loop with a sleep 300 delay so it checks every 5 minutes if
everything is okay. OTOH, my server runs fine for weeks - you should try
another VM if it keeps crashing. -- Bert Freudenberg

Reply via email to