mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +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();
|
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;
|
||||||
|
Reference in New Issue
Block a user