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

Youki exec a does not exist process will stop running container #1810

Closed
lengrongfu opened this issue Apr 13, 2023 · 3 comments · Fixed by #1818
Closed

Youki exec a does not exist process will stop running container #1810

lengrongfu opened this issue Apr 13, 2023 · 3 comments · Fixed by #1818
Assignees

Comments

@lengrongfu
Copy link
Collaborator

Steps to reproduce:

Step 1

use youki run -d {container_id} command to start a container in background mode and keep the container running continuously.
and the container status will become Running after execution.

Step 2

Use youki exec -it {container_id} /bin/bash to enter the container. If /bin/bash does not exist in the container, it will fail to enter the container, and the container status will become Stopped after execution.

I use runc to test, there is no such problem.

The following is the error exec log:

[DEBUG crates/libcontainer/src/capabilities.rs:135] 2023-04-13T14:32:53.549633813+08:00 dropping bounding capabilities to Some({AuditWrite, Kill, NetBindService})
[DEBUG crates/libcontainer/src/process/fork.rs:40] 2023-04-13T14:32:53.550891240+08:00 failed to run child process in clone: executable '/bin/bash' for container process does not exist
[INFO crates/libcgroups/src/common.rs:208] 2023-04-13T14:32:53.552311362+08:00 cgroup manager V2 will be used
[DEBUG crates/libcgroups/src/v2/manager.rs:132] 2023-04-13T14:32:53.552426219+08:00 remove cgroup "/sys/fs/cgroup/test"
exec failed : failed to create container
@utam0k utam0k added the bug label Apr 13, 2023
@utam0k
Copy link
Member

utam0k commented Apr 13, 2023

@lengrongfu Thanks for your report. Please give us the result of youki info

@lengrongfu
Copy link
Collaborator Author

$ youki info
Version           0.0.5
Commit            6a7afb07
Kernel-Release    5.19.0-31-generic
Kernel-Version    #32-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 20 15:20:08 UTC 2023
Architecture      x86_64
Operating System  Ubuntu 22.10
Cores             2
Total Memory      6941
Cgroup setup      unified
Cgroup mounts
Namespaces        enabled
  mount           enabled
  uts             enabled
  ipc             enabled
  user            enabled
  pid             enabled
  network         enabled
  cgroup          enabled
Capabilities
CAP_BPF           available
CAP_PERFMON       available
CAP_CHECKPOINT_RESTORE available

@yihuaf
Copy link
Collaborator

yihuaf commented Apr 14, 2023

The fix is simple. I am surprised that this case is not covered with the integration test already. We should find a way to test this behavior.

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

Successfully merging a pull request may close this issue.

3 participants