diff --git a/src/exec.c b/src/exec.c index 6fea52e..e0a04f3 100644 --- a/src/exec.c +++ b/src/exec.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include "syscall.h" @@ -407,7 +408,8 @@ int hyper_exec_cmd(char *json, int length) } arg.exec = exec; - pid = clone(hyper_do_exec_cmd, stack + stacksize, CLONE_VM| CLONE_FILES, &arg); + pid = clone(hyper_do_exec_cmd, stack + stacksize, CLONE_VM| CLONE_FILES| SIGCHLD, &arg); + fprintf(stdout, "do_exec_cmd pid %d\n", pid); free(stack); if (pid < 0) { perror("clone hyper_do_exec_cmd failed"); diff --git a/src/init.c b/src/init.c index dfd6a96..7893c08 100644 --- a/src/init.c +++ b/src/init.c @@ -468,7 +468,7 @@ int hyper_start_containers(struct hyper_pod *pod) goto out; } - pid = clone(hyper_do_start_containers, stack + stacksize, CLONE_VM| CLONE_FILES, &arg); + pid = clone(hyper_do_start_containers, stack + stacksize, CLONE_VM| CLONE_FILES| SIGCHLD, &arg); free(stack); if (pid < 0) { perror("enter container pid ns failed"); @@ -932,7 +932,7 @@ static int hyper_cmd_read_file(char *json, int length, uint32_t *datalen, uint8_ arg.data = data; sprintf(arg.root, "/tmp/hyper/%s/root/%s/", c->id, c->rootfs); - pid = clone(hyper_do_cmd_read_file, stack + stacksize, CLONE_VM, &arg); + pid = clone(hyper_do_cmd_read_file, stack + stacksize, CLONE_VM| SIGCHLD, &arg); free(stack); if (pid < 0) { perror("fail to fork writter process");