mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-09-03 12:11:34 +00:00
ensure the mnt_ns opened before the process exit
quote of the log: > open container mount ns failed: No such file or directory > start containers failed the process exits when hyper_enter_sandbox(), so we have to move the wait before hyper_enter_sandbox(). Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
+6
-6
@@ -507,6 +507,12 @@ static int hyper_setup_container_rootfs(void *data)
|
||||
int setup_dns;
|
||||
uint32_t type;
|
||||
|
||||
/* wait for ns-opened ready message */
|
||||
if (hyper_get_type(arg->pipens[0], &type) < 0 || type != READY) {
|
||||
fprintf(stderr, "wait for /proc/self/ns/mnt opened failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (hyper_enter_sandbox(arg->pod, -1) < 0) {
|
||||
perror("enter sandbox failed");
|
||||
goto fail;
|
||||
@@ -626,12 +632,6 @@ static int hyper_setup_container_rootfs(void *data)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* wait for ns-opened ready message */
|
||||
if (hyper_get_type(arg->pipens[0], &type) < 0 || type != READY) {
|
||||
fprintf(stderr, "wait for /proc/self/ns/mnt opened failed\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
hyper_send_type(arg->pipe[1], READY);
|
||||
fflush(NULL);
|
||||
_exit(0);
|
||||
|
||||
Reference in New Issue
Block a user