From owner-freebsd-questions Tue Aug 7 22:16:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id ECDD437B40A for ; Tue, 7 Aug 2001 22:16:46 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 1721 invoked by uid 100); 8 Aug 2001 05:16:46 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15216.52030.274217.805309@guru.mired.org> Date: Wed, 8 Aug 2001 00:16:46 -0500 To: "Graham White" Cc: questions@freebsd.org Subject: Re: Perl Script In-Reply-To: <26247968@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Graham White types: > This is a multi-part message in MIME format. > > ------=_NextPart_000_0014_01C11F81.BCE87E00 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: 7bit > > Does anyone have an example of a Perl script that constantly loops and > checks the loadaverage of a machine, if the loadaverage is over a > certain amount then it will stop and restart a program or program(s) ? > Thanks Gods, man - look at all the crap your mailer added to this simple question! That's the argument I've seen for why sending both HTML and plain text is discouraged on -questions. > ------=_NextPart_000_0014_01C11F81.BCE87E00 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > xmlns:w=3D"urn:schemas-microsoft-com:office:word" = > xmlns=3D"http://www.w3.org/TR/REC-html40"> > > > charset=3Diso-8859-1"> > > > > > > > > > > > > style=3D'tab-interval:36.0pt'> > >
> >

style=3D'font-size:10.0pt; > font-family:Arial;mso-ansi-language:EN-US'>Does anyone have an example = > of a class=3DSpellE>Perl script that constantly loops and checks the = > class=3DSpellE>loadaverage of a machine, style=3D'mso-spacerun:yes'>=A0 if the class=3DSpellE>loadaverage > is over a certain amount then it will stop and restart a program or = > program(s) ? > Thanks

> >
> > > > > > ------=_NextPart_000_0014_01C11F81.BCE87E00-- > Now, to answer the question. If you have a background computing task you'd like to stop under those conditions, have it exit and requeue itself via the batch command. If the idea is to control access to some service, you can either use batch to do something to close access, or integrate it into the service properly. If the problem is some program that's going crazy and chewing up to much CPU, you should fix the program in question, or use nice on it. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message