At 12:52 PM -0400 9/25/96, Evan Champion wrote:
>Brent Chapman wrote:
>> # Check the load; if it's too high, none of the rest of this matters...
>> $uptime = `/usr/bin/uptime`;
>> $uptime =~ s/.*:\s*//;
>> $uptime =~ s/,.*//;
>> if ($uptime >= 8.0) {
>> exit 75; # EX_TEMPFAIL
>> }
>
>I'm going to give that a try. An even better idea might be to add load
>checking to the wrapper; the load of starting the wrapper should be much
>lower than starting perl.
The wrapper is a setuid-root program, and thus potentially very dangerous.
To minimize that danger, it should do one thing and one thing only: set the
UID/GID that the rest of the code is going to operate under. It should be
as simple as it can possibly be. Figuring out the current load in a C
program is decidedly NOT simple...
-Brent
----------------------+----------------------------+------------------------
Brent Chapman | Great Circle Associates | 1057 West Dana Street
Brent@GreatCircle.COM | http://www.greatcircle.com | Mountain View, CA 94041
----------------------+----------------------------+------------------------
Internet Tutorials from the Experts!
References:
|
|