How to Write an Infinite Loop that doesn't Die when Program Dies



I have a web server on a Linux platform that keeps dying if I give it
a big enough load, with nothing more than the message "Killed" on one
line. What I'd _like_ to do is write a shell script that goes into an
infinite loop calling this web server over and over again, so that as
soon as it dies it executes again. So I wrote:

#! /bin/sh
if [ $# == 1 ]
then
while [ 1 ]
do
~/Bin/ipcrmGroup.pl kvnsmnsn
echo "./Ws4Server $1"
~/public_html/CS360/Ws4Server $1
done
else
echo "Usage is"
echo " ./InfLoop <port>"
fi

Unfortunately, every time my web server dies, this script dies. How
can I run this web server in this loop in such a way that when the
web server is killed the loop keeps going?

---Kevin Simonson

"You'll never get to heaven, or even to LA,
if you don't believe there's a way."
from _Why Not_
.



Relevant Pages

  • Re: any try this forth webserver? the code looks incomprehensible to me http://www.jwdt.com/~paysan/
    ... statements; what are the control variables in a loop; what arguments ... web server works, then none of this is going to make any sense to ... web servers like Apache, your mind seemed to latch onto the notion ... He only cares about text/html, ...
    (comp.lang.forth)
  • Re: vwait behavior
    ... following loop on a linux web server and it will run fine ... search for "recursive event loop". ... fraction of events that take a long time to handle or invoke [pause] ... Doesn't apply here since there's no way for vwaits to nest (assuming ...
    (comp.lang.tcl)
  • Re: sometimes endless loop, sometimes not
    ... > after the loop, or remove the On Error Resume Next, eg. ... and ensure that row level locking isn't being disabled. ... > use it on my web server and moved to SQL Server when I started getting ... >>> Dan ...
    (microsoft.public.data.ado)
  • Re: How to Write an Infinite Loop that doesnt Die when Program Dies
    ... is a simpler way to start an infinite loop. ... Unfortunately, every time my web server dies, this script dies. ...
    (comp.unix.shell)
  • Re: checking for a file
    ... echo "The file $filename does not exist"; ... out of the loop early. ... Are you able to run scripts on your web server? ...
    (alt.html)