Re: A script stops halfway before the supposed natural end without any error/warning message
From: Chip C (chipc_0517_at_yahoo.com)
Date: 23 Jul 2004 06:18:21 -0700
"Alex Shi" <firstname.lastname@example.org> wrote in message news:<UibLc.email@example.com>...
> > In article <T0bLc.firstname.lastname@example.org>, "Alex Shi"
> <email@example.com> writes:
> > > Hi All,
> > >
> > > I have a php script running on shell. Basically it checks more
> > > than 10k phone numbers one by one in a loop way. It will send
> > > each of the numbers to a remote host for validation checking,
> > > and write the result to a local file. On one server (an in-house
> > > built Linux), it is running perfect. However, on another server
> > > (RH 9), it's hehavior is very strange: it will stop at a phone number
> > > between the 900th to 1000th without any error message. Looks
> > > like it stops naturally, but this is not a natural end. It is supposed
> > > to stop after the last phone number was checked.
> > > I am thinking it might be the case that the script received a stop
> > > signal from the system. - I have no idea, but just guess. I am not
> > > a UNIX people. I think in this group maybe someone can give
> > > me a hand. Thanks in advance!
> > >
> > > Alex
> > >
> > >
> > I have seen a /bin/tcsh login shell that sets
> > autologout 60
> > and then logs out after 60 CPU seconds.
> > If this is the case with your login shell, the fix is:
> > unset autologout
> > --
> > Michael Tosch
> > IT Specialist
> > HP Managed Services Germany
> > Phone: +49 2407 575 313
> > Mail: michael.tosch:hp.com
> The login session won't be closed but just the script stops.
This does sound like the script is hitting a resource limit. Do
ulimit -a *in the exact environments that the script is running in*
and see how it differs from one system to the other.
But foremost, you defnitely should be capturing and reporting the exit
status of the script's process. If that doesn't provide a clue,
instrument the script with output statements to some log file ("Now
I'm at step A..."). If it's a resource limit such as cpu, the
instrumented script may die at a different point than the normal one;
if it's a data error or system environment problem, or some array is
hitting a memory size limit, it'll die at the same place.