mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 22:05:36 +00:00
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: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
@@ -42,26 +42,26 @@ int main(int argc, char **argv)
|
||||
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) {
|
||||
pr_perror("write");
|
||||
return 1;
|
||||
}
|
||||
if (unshare(CLONE_NEWNS)) {
|
||||
pr_perror("unshare");
|
||||
return 1;
|
||||
}
|
||||
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
|
||||
if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) {
|
||||
pr_perror("write");
|
||||
return 1;
|
||||
}
|
||||
while (1)
|
||||
sleep(1);
|
||||
return 1;
|
||||
}
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
|
||||
if (write(fds[1], &fd, sizeof(fd)) != sizeof(fd)) {
|
||||
pr_perror("write");
|
||||
return 1;
|
||||
}
|
||||
prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
|
||||
while (1)
|
||||
sleep(1);
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user