Hi,
I'm trying to launch executables with cfengine 3.0.3 community using
cygwin. However, when using "commands", the executables are not
recognized as executables. And when using execresult, I don't have any
information that the execution failed if it not an executable (it seems
that the cfengine error output is redirected to the variable)
Here is a test promises to reproduce the error :
bundle agent test
{
vars:
"UUID" string => execresult("/cygdrive/c/WINDOWS/system32/cscript
/Nologo uuid.vbs","noshell");
"UUID2" string => execresult("C:\WINDOWS\system32\cscript.exe /Nologo
uuid.vbs","noshell");
"test" string => execresult("C:\chifoumi","noshell");
commands:
"/cygdrive/c/WINDOWS/system32/cscript.exe";
"/cygdrive/c/WINDOWS/system32/cscript";
"C:/WINDOWS/system32/cscript.exe";
"C://WINDOWS//system32//cscript.exe";
"C:\WINDOWS\system32\cscript.exe";
"C:\\WINDOWS\\system32\\cscript.exe";
reports:
windows::
"Variable is $(UUID) $(UUID2)";
"Error is $(test)";
}
The outcome is :
(...)
cf3 /cygdrive/c/WINDOWS/system32/cscript.exe promises to be executable
but isn't
cf3 I: Report relates to a promise with handle ""
cf3 I: Made in version 'not specified' of './uuid.cf' near line 22
cf3 /cygdrive/c/WINDOWS/system32/cscript promises to be executable but isn't
cf3 I: Report relates to a promise with handle ""
cf3 I: Made in version 'not specified' of './uuid.cf' near line 24
cf3 C:/WINDOWS/system32/cscript.exe promises to be executable but isn't
cf3 I: Report relates to a promise with handle ""
cf3 I: Made in version 'not specified' of './uuid.cf' near line 26
cf3 C://WINDOWS//system32//cscript.exe promises to be executable but isn't
cf3 I: Report relates to a promise with handle ""
cf3 I: Made in version 'not specified' of './uuid.cf' near line 28
cf3 C:\WINDOWS\system32\cscript.exe promises to be executable but isn't
cf3 I: Report relates to a promise with handle ""
cf3 I: Made in version 'not specified' of './uuid.cf' near line 30
cf3 C:\WINDOWS\system32\cscript.exe promises to be executable but isn't
cf3 I: Report relates to a promise with handle ""
cf3 I: Made in version 'not specified' of './uuid.cf' near line 32
(..)
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: Variable is
056013BB-3B72-BA43-83E6-BF9A0D47455D 056013BB-3B72-BA43-83E6-BF9A0D47455D
cf3 .........................................................
cf3
cf3 R: Variable is 056013BB-3B72-BA43-83E6-BF9A0D47455D
056013BB-3B72-BA43-83E6-BF9A0D4745
5D
cf3
cf3 .........................................................
cf3 Promise handle:
cf3 Promise made by: Error is cf3 Couldn't run C:\chifoumi cf3 !!!
System error for execv: "No such file or directory"
cf3 .........................................................
cf3
cf3 R: Error is cf3 Couldn't run C:\chifoumi cf3 !!! System error for
execv: "No such file or directory"
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine