help-cfengine
[Top][All Lists]
Advanced

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

Re: [Cfengine] process and filters


From: Bas van der Vlies
Subject: Re: [Cfengine] process and filters
Date: Thu, 5 Dec 2002 12:28:35 +0100

Sorry is my fault, cfengine can handle this (Always read the doc ;-) ).
there is an option:
   action=bymatch

That is exactly what i wanted. Only one thing. If a specify this option
and i run cfagent verbose. It looks like it is signalling the process but
is not, because the check of how many matches is later.

cfengine:arrakis: Signalling process 35426 (cfexecd) with SIGKILL

I personally think that this message must not be displayed if
action=bymatch is specified:

process.c (version 2.0.4)

function FindMatches:

  snprintf(OUTPUT,bufsize*2,"Signalling process %d (%s) with 
%s\n",pid,pp->expr,SIGNALS[pp->signal]);
  CfLog(cfinform,OUTPUT,"");

 must be replaced by:

 if (pp->action != 'm')
    {
    snprintf(OUTPUT,bufsize*2,"Signalling process %d (%s) with 
%s\n",pid,pp->expr,SIGNALS[pp->signal]);
    CfLog(cfinform,OUTPUT,"");
    }



On Tue, 3 Dec 2002 15:13:52 +0100
Bas van der Vlies <basv@sara.nl> wrote:

> I am now using filters for processes. I want to track down some daemons and 
> make sure that only one runs ( or a specified number). If there are more then 
> one process or less. It must kill the processes and start daemon. 
> I use the following code:
> 
> control:
> 
>   IfElapsed = ( 0 )
>   actionsequence = ( processes )
> 
> processes:
>   "cfexecd"
>      filter=daemons matches=1 action=do signal=kill
>      restart "/etc/init.d/cfexecd restart"
> 
> filters:
>   { daemons
>     PPID: "[ ]+1"
>     Result: "PPID"
>   }
> 
> 
> This code will always kill the 'cfexecd'-daemon and then restart it. What i
> expected was that it will only kill the process if the number of processes
> does not match with 'matches' option. Is this a bug, misconfiguration or 
> intended?
> 
> PS) If this is a bug then i have the time to fix this.
> 
> 
> --
> ********************************************************************
> *                                                                  *
> *  Bas van der Vlies                     e-mail: basv@sara.nl      *
> *  SARA - Academic Computing Services    phone:  +31 20 592 8012   *
> *  Kruislaan 415                         fax:    +31 20 6683167    *
> *  1098 SJ Amsterdam                                               *
> *                                                                  *
> ********************************************************************
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> _______________________________________________
> Cfengine mailing list
> Cfengine@mailgate.sara.nl
> http://mailgate.sara.nl/mailman/listinfo/cfengine


--
********************************************************************
*                                                                  *
*  Bas van der Vlies                     e-mail: basv@sara.nl      *
*  SARA - Academic Computing Services    phone:  +31 20 592 8012   *
*  Kruislaan 415                         fax:    +31 20 6683167    *
*  1098 SJ Amsterdam                                               *
*                                                                  *
********************************************************************




reply via email to

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