Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

ctrl-c stop vmcache server will stop all containers that its VM is created by it #1726

Closed
teawater opened this issue May 23, 2019 · 0 comments

Comments

@teawater
Copy link
Member

In terminal a:

kata-runtime --kata-config=/etc/kata-containers/c.toml --log=$(tty) factory init
...
...

In terminal b:

sudo docker run --runtime=c -it --rm busybox
/ #

In terminal a:
ctrl-c to stop vmcache server.

^CINFO[0114] VM cache server stop                          arch=amd64 command=factory endpoint=/var/run/kata-containers/cache2.sock name=kata-runtime pid=53328 source=runtime
INFO[0114] stop vm                                       arch=amd64 command=factory name=kata-runtime pid=53328 source=virtcontainers vm=045e062e-b12f-488c-b171-e955a7c506c6
INFO[0114] Stopping Sandbox                              arch=amd64 command=factory name=kata-runtime pid=53328 source=virtcontainers subsystem=qemu
INFO[0114] {"execute":"quit"}                            arch=amd64 command=factory name=kata-runtime pid=53328 source=virtcontainers subsystem=qmp
INFO[0114] {"return": {}}                                arch=amd64 command=factory name=kata-runtime pid=53328 source=virtcontainers subsystem=qmp
INFO[0114] {"timestamp": {"seconds": 1558582733, "microseconds": 572003}, "event": "SHUTDOWN", "data": {"guest": false}}  arch=amd64 command=factory name=kata-runtime pid=53328 source=virtcontainers subsystem=qmp
INFO[0114] cleanup vm path                               arch=amd64 command=factory dir=/run/vc/vm/045e062e-b12f-488c-b171-e955a7c506c6 link=/run/vc/vm/045e062e-b12f-488c-b171-e955a7c506c6 name=kata-runtime pid=53328 source=virtcontainers subsystem=qemu

In terminal b:

sudo docker run --runtime=c -it --rm busybox
/ # teawater@teawater-virtual-machine:~$
@teawater teawater changed the title ctrl-c stop vmcache server will stop all containers that is created by it ctrl-c stop vmcache server will stop all containers that its VM is created by it May 23, 2019
teawater added a commit to teawater/runtime that referenced this issue May 23, 2019
After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
@devimc devimc closed this as completed in 19115ef May 24, 2019
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 3, 2019
There is an issue that ctrl-c stop vmcache server will stop all
containers that its VM is created by it.
The cause is kata-proxy and vmcache server use same tty, for example:
ps -e | grep kata
3617 pts/5    00:00:00 kata-runtime
3636 pts/5    00:00:00 kata-proxy
Ctrl-c will send signal to both kata-proxy and vmcache server.
Then the containers that its VM is created by this vmcache server will
quit with it.

Set Setsid to true when exec kata-proxy to handle this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 19115ef)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 3, 2019
After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 7bf6c67)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 3, 2019
There is an issue that ctrl-c stop vmcache server will stop all
containers that its VM is created by it.
The cause is kata-proxy and vmcache server use same tty, for example:
ps -e | grep kata
3617 pts/5    00:00:00 kata-runtime
3636 pts/5    00:00:00 kata-proxy
Ctrl-c will send signal to both kata-proxy and vmcache server.
Then the containers that its VM is created by this vmcache server will
quit with it.

Set Setsid to true when exec kata-proxy to handle this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 19115ef)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 3, 2019
After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 7bf6c67)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 4, 2019
There is an issue that ctrl-c stop vmcache server will stop all
containers that its VM is created by it.
The cause is kata-proxy and vmcache server use same tty, for example:
ps -e | grep kata
3617 pts/5    00:00:00 kata-runtime
3636 pts/5    00:00:00 kata-proxy
Ctrl-c will send signal to both kata-proxy and vmcache server.
Then the containers that its VM is created by this vmcache server will
quit with it.

Set Setsid to true when exec kata-proxy to handle this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 19115ef)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 4, 2019
After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 7bf6c67)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 4, 2019
There is an issue that ctrl-c stop vmcache server will stop all
containers that its VM is created by it.
The cause is kata-proxy and vmcache server use same tty, for example:
ps -e | grep kata
3617 pts/5    00:00:00 kata-runtime
3636 pts/5    00:00:00 kata-proxy
Ctrl-c will send signal to both kata-proxy and vmcache server.
Then the containers that its VM is created by this vmcache server will
quit with it.

Set Setsid to true when exec kata-proxy to handle this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 19115ef)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 4, 2019
After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 7bf6c67)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 5, 2019
There is an issue that ctrl-c stop vmcache server will stop all
containers that its VM is created by it.
The cause is kata-proxy and vmcache server use same tty, for example:
ps -e | grep kata
3617 pts/5    00:00:00 kata-runtime
3636 pts/5    00:00:00 kata-proxy
Ctrl-c will send signal to both kata-proxy and vmcache server.
Then the containers that its VM is created by this vmcache server will
quit with it.

Set Setsid to true when exec kata-proxy to handle this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 19115ef)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
ganeshmaharaj pushed a commit to ganeshmaharaj/kata-runtime that referenced this issue Jun 5, 2019
After previous commit, found that kata-proxy is not quit
when vmcache server is stopped by ctrl-c.
The cause is current kata-proxy is setsid when it exec.  It will
not get the signal ctrl-c.

Call vm.Disconnect() when close vm in cache factory to handle
this issue.

Fixes: kata-containers#1726

Signed-off-by: Hui Zhu <[email protected]>
(cherry picked from commit 7bf6c67)
Signed-off-by: Ganesh Maharaj Mahalingam <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant