Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bocker exec fails #15

Closed
basdp opened this issue Jul 30, 2015 · 6 comments
Closed

bocker exec fails #15

basdp opened this issue Jul 30, 2015 · 6 comments

Comments

@basdp
Copy link

basdp commented Jul 30, 2015

Bocker exec fails always, it just outputs a long list of increasing integers. Am I doing something wrong, or is this a bug? I can't find any documentation about exec. All the other commands are working.

@p8952
Copy link
Owner

p8952 commented Jul 31, 2015

Hey @basdp

This is a bug, something isn't working quite right with bocker exec. I thought it might be fixed with 11129ae but it's still not quite right.

@basdp
Copy link
Author

basdp commented Aug 3, 2015

What is still not right?

@p8952
Copy link
Owner

p8952 commented Aug 3, 2015

Sorry, I mean I thought 11129ae would also fix the exec issues, but it didn't. Exec still isn't working once the original process dies.

@p8952
Copy link
Owner

p8952 commented Aug 3, 2015

Ok so there are two issues here.

Start a container:

    bocker run img_42078 "while :; do echo 'foo'; sleep 5; done"

Try and exec a command with multiple words = FAILS:

    bocker exec ps_42201 ps aux
    chroot: failed to run command ‘ps aux’: No such file or directory`

Try and exec a command with one word = WORKS:

    bocker exec ps_42201 bash
    ps aux
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.2  11116  1392 ?        S+   18:31   0:00 /bin/sh -c /bin/mount -t proc proc /proc && while :; do echo 'foo'; sleep 5; done
    root         8  0.0  0.1   5884   612 ?        S+   18:31   0:00 sleep 5
    root         9  0.0  0.3  13344  1952 ?        S    18:31   0:00 bash
    root        22  0.0  0.2  21364  1376 ?        R+   18:31   0:00 ps aux

Ctrl-C the bocker run command and then try to re-enter it = FAILS:

    bocker exec ps_42201 bash
    nsenter: failed to parse pid: 'PID
    1
    2
    3
    ...
    24105
    24106
    24107

So what needs doing here is:

  1. Correctly quote and pass arguments into the container when exec'ing.
  2. Throw an error if the container is not running.

@p8952
Copy link
Owner

p8952 commented Aug 3, 2015

I'm going to keep tracking the spewing out numbers issue here and the multiple words one at #20

@p8952
Copy link
Owner

p8952 commented Aug 5, 2015

Should be resolved by 7911226

@p8952 p8952 closed this as completed Aug 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants