/etc/rc omits CMD arguments

Open
#112 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
shell
Domain
cli, devops

Research direction

Start in /etc/rc and reproduce the issue with a Dockerfile CMD such as ./run.sh arg1 arg2. Trace how that command becomes the /usr/local/bin/nvidia_enrtypoint.sh invocation, then verify that the completed change preserves all CMD arguments when run inside the extracted container.

Written by the indexing model from the issue text.

Description

When I package up a container with enroot that has the following CMD line:

CMD ./run.sh arg1 arg2 arg2

...it results in this command being run by /etc/rc within the extracted container:

exec /usr/local/bin/nvidia_enrtypoint.sh /bin/sh -c ./run.sh arg1 arg2 arg3

Notice the lack of quotes--run.sh is run without arguments, which causes it to die immediately. When I put quotes around ./run.sh arg1 arg2 arg3, or remove /bin/sh -c, it works as expected. From what I've read, that CMD invocation is legitimate, so I would advocate for the removal of /bin/sh -c from the exec command.

Dominant language
Shell
Stars
1.1k
Forks
139
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NVIDIA/enroot

All issues in NVIDIA/enroot

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.