help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cfagent problem


From: Brendan Strejcek
Subject: Re: cfagent problem
Date: Tue, 3 Jan 2006 10:54:36 -0600
User-agent: Mutt/1.5.6+20040818i

Luiz Gustavo Anflor Pereira wrote:

> Cfexecd is running on background as a daemon, and it happens to be
> executed when the nfs is down (os lost, or..). When this occurs, it
> seems that cfagent hungs up, not terminating.

You might want to strace (truss, ktrace, whatever) the processes in
question to make sure that NFS is the problem (though I would not be
surprised if it is).

Also, take a look at these:

    http://www.cfengine.org/docs/cfengine-Reference.html#index-MaxCfengines-60

    http://www.cfengine.org/docs/cfengine-Reference.html#IfElapsed

Just to be extra safe, I also use a cron job:

    #!/bin/sh
    
    PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH
    
    SELF=`basename $0`
    UNAME_N=`uname -n`
    
    if test `uname` = SunOS; then
        PS=`/bin/ps -eo uid,pid,args`
    else
        PS=`/bin/ps ax`
    fi
    
    NUM_CFAGENTS=`echo "$PS" | grep [c]fagent | wc -l | awk '{ print $1 }'`
    
    if test "$NUM_CFAGENTS" -gt 4; then
        echo $SELF: More than 4 cfagents are running on $UNAME_N.
        echo $SELF: Assuming something went wrong.
        echo $SELF: Killing all cfengine processes.
    
        which pkill >/dev/null 2>&1
        if test "$?" != 0; then
            echo $SELF: Unable to locate \"pkill\" in $PATH.
            echo $SELF: You probably want to kill all cfagents by hand.
            echo $SELF: Aborting.
        fi
    
        pkill -u root cfagent
        pkill -u root cfexecd
        sleep 3
        pkill -9 -u root cfagent
        pkill -9 -u root cfexecd
    fi

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science

http://www.cs.uchicago.edu/people/brendan
http://praksys.blogspot.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]