criu-ns: make pidns init first do setsid

We see that on criu-ns dump/restore/dump of the process which initially
was not a session leader (with --shell-job option) we see sid == 0 for
it and fail with something like:

Error (criu/cr-dump.c:1333): A session leader of 41585(41585) is outside of its pid namespace

Note: We should not dump processes with sid 0 (even with --shell-job) as
on restore we can can put such processes from multiple sessions into
one, which is wrong.

Fixes: #232

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
This commit is contained in:
Pavel Tikhomirov 2021-10-18 18:43:14 +03:00 committed by Andrei Vagin
parent c750e62cac
commit e3a853ab99

View file

@ -102,6 +102,7 @@ def wrap_restore():
criu_pid = os.fork()
if criu_pid == 0:
os.setsid()
_mount_new_proc()
run_criu(restore_args)