Skip to content

docs(exec-source): README examples pass a multi-word --command without --shell and fail to start #19

Description

@rrrodzilla

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions