Commit 1971cab9 authored by Andrei Vagin's avatar Andrei Vagin

zdtm/tempfs_subns: sync children with the main process

All static tests has to stop any activity before C/R.

./tempfs_subns --pidfile=tempfs_subns.pid --outfile=tempfs_subns.out --dirname=tempfs_subns.test
Run criu dump
Unable to kill 128: [Errno 3] No such process
Run criu restore
7: Old mounts lost: []
7: New mounts appeared: [('/rootfs/criu/test', '/'), ('/', '/proc'), ('/', '/dev/pts')]
:
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 7470b163
...@@ -42,26 +42,26 @@ int main(int argc, char **argv) ...@@ -42,26 +42,26 @@ int main(int argc, char **argv)
pid = fork(); pid = fork();
if (pid == 0) { if (pid == 0) {
if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) {
pr_perror("write");
return 1;
}
if (unshare(CLONE_NEWNS)) { if (unshare(CLONE_NEWNS)) {
pr_perror("unshare"); pr_perror("unshare");
return 1; return 1;
} }
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0); prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) {
pr_perror("write");
return 1;
}
while (1) while (1)
sleep(1); sleep(1);
return 1; return 1;
} }
pid = fork(); pid = fork();
if (pid == 0) { if (pid == 0) {
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) { if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) {
pr_perror("write"); pr_perror("write");
return 1; return 1;
} }
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
while (1) while (1)
sleep(1); sleep(1);
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment