help-cfengine
[Top][All Lists]
Advanced

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

Re: Please help: "actionsequence classes" example for synchronization?


From: Adams, Russell L.
Subject: Re: Please help: "actionsequence classes" example for synchronization?
Date: Fri, 26 Aug 2005 09:01:43 -0500
User-agent: Mutt/1.4.2.1i

When you specify a class in the action sequence, the class is defined
and the action executed in the order given in actionsequence.

control: actionsequence = ( shellcommands.one
                            shellcommands.two
                            shellcommands.three
                            shellcommands
                            )

First, shellcommands is executed with 'one' defined, then again with
'two' defined, then again with 'three' defined. It is then executed
again with no extra classes.

That way with conditional shellcommands dependent on the extra classes
you can have effectively sequential actions.

shellcommands:

        one::   '/bin/echo this is one'
        two::   '/bin/echo this is two'
        three:: '/bin/echo this is three'
        any::   '/bin/echo any'

The any shellcommand would only execute once due to locking, but it'll
kick off during any call to shellcommands.

Does that help?

Russell

On Thu, Aug 25, 2005 at 08:37:41PM -0700, ha haha wrote:
> Hi,
> 
>  Anyone could shed a light on "actionsequence class"
> for synchronization -- make certain actions occur in
> certain order? I tried several hours but still have no
> luck.
> 
>  The following is an excerpt from cfengine Tutorial:
> 
> ---------------------------------------------------
> 
> Here is an example: 
> 
>      
>        links.onlysome
>        shellcommands.othersymbols.onlysome
>      
> 
> In the first case onlysome is defined to be true while
> this instance of links is executed. That means that
> only actions labelled with the class onlysome will be
> executed as a result of that statement. In the latter
> case, both onlysome and othersymbols are defined to be
> true for the duration of shellcommands. 
> 
> This syntax would normally be used to omit certain
> time-consuming actions, such as tidying all home
> directories. Or perhaps to synchronize certain actions
> which have to happen in a certain order. 
> -----------------------------------------------------
> 
> My test results seem conflicting with the above
> statement...  Both actions labeled with and without
> the "actionsequence class" are executed. ONLY actions
> With NEGATE (!) "actionsequence class" are not excuted
> at the same time -- they are being run later.
> But that may not be the "actionsequence class" are
> designed to go.. Please help.
> 
> 
> My cfengine is 2.1.15 running on Fedora Core Linux.
> 
> The cfengine configuration cfagent.conf is:
> 
> control:
> 
>    actionsequence = (
>                         ...
>                         shellcommands.ASClass
>                         shellcommands
>                     )   
> 
> shellcommands:
> 
>    linux::
>         "/bin/echo no ASClass class, either define or
> undefine, is in use."
> 
>    linux.ASClass::
>         "/bin/echo actionSequence calsses is defined."
> 
>    linux.!ASClass::
>         "/bin/echo ASClass is not defined at this
> run."
> 
> ...
> 
> The verbose result is attached as well.
> 
> ...
> 
> *********************************************************************
>  Main Tree Sched: shellcommands.ASClass pass 1 @ Thu
> Aug 25 19:53:41 2005
> *********************************************************************
> 
> 
>                   New temporary class additions
>                   --------( Pass 1 )-------
>                              ASClass
> cfengine:testBox: Executing script /bin/echo no
> ASClass class, either define or undefine, is in
> use....(timeout=0,uid=-1,gid=-1)
> (Setting umask to 77)
> cfengine:testBox:/bin/echo no AS: no ASClass class,
> either define or undefine, is in use.
> cfengine:testBox: Finished script /bin/echo no ASClass
> class, either define or undefine, is in use.
> cfengine:testBox: Executing script /bin/echo
> actionSequence calsses is
> defined....(timeout=0,uid=-1,gid=-1)
> (Setting umask to 77)
> cfengine:testBox:/bin/echo actio: actionSequence
> calsses is defined.
> cfengine:testBox: Finished script /bin/echo
> actionSequence calsses is defined.
> *********************************************************************
>  Main Tree Sched: shellcommands pass 1 @ Thu Aug 25
> 20:28:11 2005
> *********************************************************************
> 
> cfengine:testBox: Executing script /bin/echo ASClass
> is not defined at this
> run....(timeout=0,uid=-1,gid=-1)
> (Setting umask to 77)
> cfengine:testBox:/bin/echo ASCla: ASClass is not
> defined at this run.
> cfengine:testBox: Finished script /bin/echo ASClass is
> not defined at this run.
> 
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine




reply via email to

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