What is wrong
Three examples in primitives/exec-source/README.md pass a multi-word command without --shell:
exec-source --command "ls -la"
exec-source --command "df -h" --interval 60000
args = ["--command", "df -h", "--interval", "60000"]
Without --shell, build_command in primitives/exec-source/src/main.rs runs --command as the executable name and takes arguments only from --args. So "df -h" is looked up as a program literally named df -h, the spawn fails, and the source exits with status 1 and this on stderr:
Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }
How it was found
Writing a new example topology for the engine docs against the released 0.12.0 binary. args = ["--command", "cat ./message.txt"] copied the README's form and the source died at startup. ["--command", "cat", "--args", "./message.txt"] works.
Fix
Correct the three examples to use --args (or --shell sh), and say in the arguments table that --command is the executable unless --shell is given.
Worth a separate look: the raw Os { code: 2 ... } message does not name the command that was not found.
What is wrong
Three examples in
primitives/exec-source/README.mdpass a multi-word command without--shell:Without
--shell,build_commandinprimitives/exec-source/src/main.rsruns--commandas the executable name and takes arguments only from--args. So"df -h"is looked up as a program literally nameddf -h, the spawn fails, and the source exits with status 1 and this on stderr:How it was found
Writing a new example topology for the engine docs against the released 0.12.0 binary.
args = ["--command", "cat ./message.txt"]copied the README's form and the source died at startup.["--command", "cat", "--args", "./message.txt"]works.Fix
Correct the three examples to use
--args(or--shell sh), and say in the arguments table that--commandis the executable unless--shellis given.Worth a separate look: the raw
Os { code: 2 ... }message does not name the command that was not found.