help-cfengine
[Top][All Lists]
Advanced

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

Re: shellcommands and ordering


From: Mark . Burgess
Subject: Re: shellcommands and ordering
Date: Thu, 16 Jan 2003 20:31:39 +0100 (MET)


This is true, but the simple method

>>              "/bin/command1"
>>              "/bin/command2"
>>              "/bin/command3"

will also work, given

1. they are next to each other in the same file
2. none of them has been executed since the last ifelapsed period.

M



On 16 Jan, Bettilyon, Allen wrote:
> 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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  address@hidden
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~






reply via email to

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