[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
shellcommands and ordering
From: |
Akop Pogosian |
Subject: |
shellcommands and ordering |
Date: |
Thu, 16 Jan 2003 03:06:13 -0800 |
User-agent: |
Mutt/1.4i |
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
- shellcommands and ordering,
Akop Pogosian <=