Re: How to Write an Infinite Loop that doesn't Die when Program Dies
- From: Barry Margolin <barmar@xxxxxxxxxxxx>
- Date: Fri, 14 Dec 2007 01:01:40 -0500
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 ***
.
- References:
- Prev by Date: Re: using a portable drive with Linux and Mac
- Next by Date: Re: Shell equivalent of continue|break ???
- Previous by thread: How to Write an Infinite Loop that doesn't Die when Program Dies
- Next by thread: tricky shell question?
- Index(es):
Relevant Pages
|