From 2e37dcf708be08dff963ee08cb7a9557f32e690d Mon Sep 17 00:00:00 2001 From: We-unite <3205135446@qq.com> Date: Fri, 19 Jul 2024 13:35:36 +0800 Subject: Fix some bugs, and 3nd coroutine can get pid tree. For some reasons, the linux kernel has made some changes in syscalls. As shown in src code, we pay attention to fork/vfork/clone to create process, while exit/exit_group to kill it. From my opinion, the fork and clone syscall should be totally different, otherwise there will be only one syscall. However, according to the logs, I heard only clone but no fork, exit_group but no exit. Infact, fork calls clone and then makes some special set. They're different, fork means parents and children, while clone means calling and callee, which allows to share sth between caller and callee. Both fork and clone makes a new process, pthread makes tasks and is called thread. Pid is factually task id. Now the 3 coroutines works well, and I've get a process tree by map[int]*process. Here hides some questions: - is it right for 2nd corutine to send to 3rd as long as eoe? - how to make the delay between exit_group and deletePid clear and suitable? Next works: - Change the pids from map into DataBase, which means that we should devide front-end and back-end. Besides, when you delete sth(such as process exit), don't delete from databese, instead just make a tag and record their exit code. In other words, we judge if it's alive not by entry existance but exit tag. - Make containers recorded, for instance, rootFS, root-process, name, id, etc.. And record them in map, maintain this database table. --- build.sh | 7 ------- 1 file changed, 7 deletions(-) delete mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh deleted file mode 100755 index 8bdadb3..0000000 --- a/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e -docker_api_version=$(docker version) -docker_api_version=$(docker version | grep API | head -n 1 | awk '{print $3}') -echo "Docker API version is $docker_api_version..." -export DOCKER_API_VERSION=$docker_api_version \ No newline at end of file -- cgit v1.2.3-70-g09d2