-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
runc fails to start: Container with id exists upon running runc #39
Comments
Steps to reproduce the problem For testing purpose whether killing runc will kill the container or not, I went and killed runc process Post that, I could not launch any container using runc command |
If you SIGKILL runc, it is not able to cleanup it's state on disk and thinks that there is already a container running. So you have to manually remove the directory in |
Thanks, it worked.. |
Maybe actual file locks should be used so they are automatically unlocked when the process dies. |
is the below functionality need to be implemented part of runc for cleaning up its state. Below was handled by execdriver in docker |
In runc, the destroy function in run.go is not getting called because of SIGKILL. Rajasec |
before the runc starts |
Maybe we need to implement |
To test whether signals reaching inside the container, I wrote small shell script to catch the signals using trap Started the container and my container process waited for signal which is expected. From the host, I've sent the signal to my container process from Host. After that I've done kill -9 4183 ( pid of runc) ~Rajasec |
I know that current golang cannot catch SIGKILL, so nobody can install the handler. Proposal
|
@jhjeong-kr runc should just delete the directory itself if the PID is dead and continue (maybe with a warning). That is standard practice with PID files. |
@CameronNemo Yes, right, but let's suppose the moment that runc finds the lock path(/var/run/ocf/). Current runc just says a fatal message which is not user-friendly. Also the message(Id is in use) is not true in case that runc was terminated by SIGKILL. Therefore, we have to distinguish between abnormal termination(such as SIGKILL) and "in use" if runc finds the lock path. |
…cf/container is exist, and 2) yield user-friendly msg Signed-off-by: Jin-Hwan Jeong <[email protected]>
runc always shows "container in use" if /var/run/ocf/container exists However, there are two cases 1) case 1: "container in use" 2) case 2: /var/run/ocf/container still exists after runc was terminated by SIGKILL or abnormal crash For case 2, runc should yield "delete the lock dir" instead of "container in use" This patch is for this issue using "pid" file in /var/run/ocf/container/task Signed-off-by: Jin-Hwan Jeong <[email protected]>
runc always shows "container in use" if /var/run/ocf/container exists However, there are two cases 1) case 1: "container in use" 2) case 2: /var/run/ocf/container still exists after runc was terminated by SIGKILL or abnormal crash For case 2, runc should yield "delete the lock dir" instead of "container in use" This patch is for this issue using "pid" file in /var/run/ocf/container/task Signed-off-by: Jin-Hwan Jeong <[email protected]> patch for issue opencontainers#39: runc always shows "container in use" if /var/run/ocf/container exists However, there are two cases 1) case 1: "container in use" 2) case 2: /var/run/ocf/container still exists after runc was terminated by SIGKILL or abnormal crash For case 2, runc should yield "delete the lock dir" instead of "container in use" This patch is for this issue using "pid" file in /var/run/ocf/container/task Also, I refined indentation and added code for slice length check Signed-off-by: Jin-Hwan Jeong <[email protected]>
@crosbymichael |
runc always shows "container in use" if /var/run/ocf/container exists However, there are two cases 1) case 1: "container in use" 2) case 2: /var/run/ocf/container still exists after runc was terminated by SIGKILL or abnormal crash For case 2, runc should yield "delete the lock dir" instead of "container in use" This patch is for this issue using "pid" file in /var/run/ocf/container/task minor revision opencontainers#1: error indentation, slice length check for "exeName" minor revision opencontainers#2: use "filepath.join" instead of "fmt.Sprintf" Signed-off-by: Jin-Hwan Jeong <[email protected]>
Closing as kill support was added in #178 |
…-4.5 [4.5] libctr/init_linux: reorder chdir
I was able to run runc successfully..
Later after exit of the container, I could not launch any of my container image ( eventhough I had rootfs and container.json properly placed)
Code: Id already in use
Message: Container with id exists: runc
I've ensure that no runc process was running earlier.
ps -eaf |grep -i runc
root 10077 9934 0 21:53 pts/31 00:00:00 grep --color=auto -i runc
Thanks
Rajasec
The text was updated successfully, but these errors were encountered: