help-cfengine
[Top][All Lists]
Advanced

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

Re: troubles with process handling


From: Ed Brown
Subject: Re: troubles with process handling
Date: Thu, 19 Jan 2006 13:44:17 -0700

It looks like a restart clause is required (tested 2.1.11 and .17):

processes:
"sshd" restart "/bin/foo" define=exists elsedefine=doesnt_exist

cfengine:: Running process command /bin/ps auxw
Defining classes exists
DoSignals(sshd)
Existing restart sequence found (/bin/foo)
cfengine:: Matches found for sshd - no restart sequence
---------------------------------------------------------------------
Alerts
---------------------------------------------------------------------
cfengine:: process is running

/bin/true could be used if all that is wanted is to be able to define
classes.

-Ed


On Thu, 2006-01-19 at 09:00 -0800, Atom Powers wrote:
> cfengine 2.1.16: no error but doesn't work.
> ----
> $/bin/ps auxw | grep sshd
> root      483  0.0  0.0  3872   228  ??  Ss   21Dec05   0:00.43 /usr/sbin/sshd
> 
> ----
> #!/var/cfengine/bin/cfagent -qvKf
> ######################################################################
> 
> control:
>   actionsequence = ( processes )
> 
> processes:
>   "sshd" define=exists elsedefine=doesnt_exist
> 
> alerts:
>   exists::
>         "process is running"
>   doesnt_exist::
>         "process is not running"
> ----
> *********************************************************************
>  Main Tree Sched: processes pass 1 @ Thu Jan 19 08:58:05 2006
> *********************************************************************
> 
> cfengine:: Running process command /bin/ps auxw
> ---------------------------------------------------------------------
> Alerts
> ---------------------------------------------------------------------
> 
> 
> 
> ++++++++++++++++++++++++++++++++++++++++
> ----
> 
> On 1/19/06, Guillaume Rousse <Guillaume.Rousse@inria.fr> wrote:
> > I'd like to manage process on clients to make sure some processes are
> > running, and some others are not. I don't want to send processes signals
> > directly, I prefer to use system service scripts, so as to take care of
> > lock file, etc... I once used restart facility, allowing to launch a
> > shell command, but only if a signal was not found, thus unable to deal
> > with shutting down processes.
> >
> > I tries to use the define and elsedefine facilities, in a similar manner
> > as I do for managing installed packages. However, it appears to trigger
> > errors in cfengine.
> >
> > The following syntax:
> > "sshd" elsedefine=need_start_sshd
> >
> > triggers the following error message:
> > Insufficient or incomplete processes statement
> >
> > I tested it with cfengine 2.1.12 and 2.1.15.
> > --
> > Any lock finish or style that you have with you will not match the rest
> > of the hardware in the building
> >                 -- Murphy's Laws of Locksmithing n°19
> >
> >






reply via email to

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