help-cfengine
[Top][All Lists]
Advanced

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

Re: shellcommands and ordering


From: Bettilyon, Allen
Subject: Re: shellcommands and ordering
Date: 16 Jan 2003 12:00:20 -0700

You can control the order like this:


control:

  actionsequence = (
        shellcommands.first
        shellcommands.second
        shellcommands.third
  )


shellcommands:
   first::
        "/bin/command1"

   second::
        "/bin/command2"

   third::
        "/bin/command3"



- Allen

On Thu, 2003-01-16 at 04:06, Akop Pogosian wrote:
> Consider this example:
> 
> shellcommands:
>       someclass::     
>               "/bin/command1"
>               "/bin/command2"
>               "/bin/command3"
> 
> 
> Suppose I want to enforce the order of the command execution the way
> it is listed above (e.g. command3 runs only after command2 which only
> runs after command1). Does cfengine automatically enforce the order of
> commands the way they are listed? Also, if two concurrent copies of
> cfengine are running, do the adaptive locks prevent the second copy
> from executing any of the commands in class someclass while the first
> copy is still running any one of the commands or do they just prevent
> the execution of the same command at the same time?
> 
> I could, of course, pass all commands as one string to the shell (e.g.
> "/bin/command1;/bin/command2;/bin/command3") but that gets ugly for
> long command sequences. Another possibility is to do something like
> this:
> 
> shellcommands:
>       someclass::
>               "/bin/command1"
>                       define=command1_completed
>       someclass.command1_completed::
>               "/bin/command2"
>                       define=command2_completed
>       someclass.command2_completed::
>               "/bin/command3"
> 
> However, this involves a lot more typing and I would prefer just
> running an external shell script instead of using this case.  The more
> I think about it the more I want to just call an external script,
> specially for more complex shell scripts.
> 
> 
> -akop
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/help-cfengine
-- 
Allen Bettilyon <address@hidden>




reply via email to

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