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



In article
<2aeff264-c800-4dc4-8ceb-b141291518da@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
kvnsmnsn@xxxxxxxxxxx wrote:

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 ]

while :

is a simpler way to start an infinite loop.

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?

Your loop looks like it should do this.

Maybe the problem is that your system is running out of resources when
you overload it, and that's killing both the script and the server.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.



Relevant Pages

  • Re: Checking the availability of a URL with VBScript
    ... loop. ... If the web server is up, and the script gets an HTTP 200 status, then ... it will always report a 200 status on each following iteration, ...
    (microsoft.public.scripting.vbscript)
  • Re: Loop aborts on web server
    ... web server of my ISP. ... the complete loop runs without ... the script many times over. ... as before without the "sleep" command. ...
    (comp.lang.perl.misc)
  • How to Write an Infinite Loop that doesnt Die when Program Dies
    ... I have a web server on a Linux platform that keeps dying if I give it ... infinite loop calling this web server over and over again, ... echo "./Ws4Server $1" ... Unfortunately, every time my web server dies, this script dies. ...
    (comp.unix.shell)
  • Re: Need help with rc startup
    ... > I have a script I want to run at system bootup to start another script ... > true" loop. ... > then either dies or gets killed. ...
    (comp.sys.hp.hpux)
  • Re: Need help with rc startup
    ... Try changing your call to the inner script to an "at now" job. ... >true" loop. ... >then either dies or gets killed. ... made through NewsOne.Net violate posting guidelines, ...
    (comp.sys.hp.hpux)