cfengine

 [image of the Head of a GNU] [ English ]

control:

   actionsequence =
    (
    module:cfload.CPUmax.CPUhigh.CPUmedium.CPUlow.MEMmax.MEMhigh.MEMmedium.MEMlow
    shellcommands
    )



shellcommands:

 # This could be done more intelligently, but as an idea

  CPUmax::

        #
        # Disable netscape and gimp if the load is too high.
        # CPUhigh is 60-90% load, max is 90+.
        #

        "/bin/mv /local/bin/netscape /local/bin/netscape.cf"
        "/bin/chmod 0700 /local/bin/netscape.cf"
        "/bin/cp /local/bin/netscape.stop /local/bin/netscape"
        "/bin/chmod 755 /local/bin/netscape"

        "/bin/mv /local/bin/gimp /local/bin/gimp.cf"
        "/bin/chmod 0700 /local/bin/gimp.cf"
        "/bin/cp /local/bin/gimp.stop /local/bin/gimp"
        "/bin/chmod 755 /local/bin/gimp"

  CPUlow|CPUmedium|CPUhigh::

        #       
        # Enable netscape and gimp if load is acceptable.
        #

        "/bin/mv /local/bin/netscape.cf /local/bin/netscape >/dev/null"
        "/bin/chmod 755 /local/bin/netscape"

        "/bin/mv /local/bin/gimp.cf /local/bin/gimp >/dev/null"
        "/bin/chmod 755 /local/bin/gimp"


[ English ]

Return to GNU's home page.

Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways to contact the FSF.

Please send comments on these web pages to webmasters@gnu.org, send other questions to gnu@gnu.org.

Copyright (C) 2001 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA

Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.

Updated: $Date: 2001/07/20 07:06:27 $ $Author: brett $