I'd like to find a way to have cfengine wait for some very long commands promises to complete.
In a simplified example, I run a long-running installer and capture the result, and conditionally run something else based on that result:
methods:
"" usebundle => step1, action => result("bigproduct_installation");
bigproduct_installation_repaired::
"" usebundle => step2;
in step1 bundle:
commands:
"/mnt/horrible_vendor/bigproduct/installer.sh";
Then in step2, I'll do all the product configuration, which really must only be done if the huge ugly installer.sh completely without errors, otherwise I can create a royal mess. There's no practical way to deduce whether it was successful by anything else than the exit code.
Things is, step1 can run for a very long time. It looks like cfengine will give up waiting for commands, and push them to the background, which is fair enough. But it means bigproduct_installation is never going to be "repaired".
A kind of ugly workaround is something like "installer.sh && touch /tmp/all_done_without_errors" and then use a fileexists("/tmp/all_done_without_errors") to trigger step2.
Is there no way to change the behaviour to let cfengine be exceptionally patient when I want it to? Where is this timeout set? I found exec_timeout, but that doesn't appear to be what i need.