Subject: Re: Stopping a runaway VAX
To: John Klos <john@sixgirls.org>
From: Pierre-Michel Ricordel <Pierre-Michel.Ricordel@imag.fr>
List: port-vax
Date: 08/09/2001 11:35:04
> So my question is this: what is the simplest, most elegant way to have a
> system task run when the load average gets too high? Also, is there an
> easy way, if any, to have cron not run a job if the last instance of that
> job is still running? Or would a little external logic be in order?

Well, if it can help you, I use this horrible code in a perl script
(Warning for the Perl gurus: close your eyes, NOW!)

    if (-e "/var/run/mylock") {die "lock file present\n";};
    `touch "/var/run/mylock`;

    #PROGRAM BODY

    `rm -f "/var/run/mylock`;

(you can open yout eyes NOW!)

That's not beautiful, but it works. I'm not a Perl expert ;-)

Also, the problems you experienced can also be produced by PID exhaution.
Symptoms: the web server works, but I can't login.
Reason: Apache doesn't forks by default, but login fails to spawn a shell.

PM