Open hafnerfe opened 2 years ago
I don't think anyone is working in this.
Thanks for the quick reply. Maybe you can help me with the issue I'm running into:
I use the restore wrapper from criu_ns, which works fine. However, I want to restore two separate processes so that both are running (I don't really care if they're in the same or different namespace, I just want to restore them without having a PID mismatch). On calling the restore wrapper the second time, I get an error from _unshare
: EINVAL.
This page about unshare writes: "EINVAL CLONE_NEWPID was specified in flags, but the process has previously called unshare() with the CLONE_NEWPID flag."
Does this mean I can't restore two process after each other? How would I go about creating a new namespace for the second process? Just ignoring the unshare error leads to more problems, like Can't open /proc/self/fd: No such file or directory
.
Thanks
@rst0git any ideas?
Hi @hafnerfe,
The criu_ns script does not seem to support lazy pages out of the box.
You should be able to call criu-ns restore
with --lazy-pages
. Why do you think that lazy-pages is not supported?
Does this mean I can't restore two process after each other?
criu-ns
creates just creates a PID and mount namespace an it runs criu restore
inside. You should be able to call criu-ns restore
multiple times. However, you need to make sure that multiple instances of the process would not interfere with each other, e.g., modify files in the file system. In this case, it would be better to run the process inside a container. This would allow you to checkpoint/restore the root file system as well.
I get an error from _unshare: EINVAL.
Could please share more information about how to replicate the error?
Thanks for the quick reply!
I must have made some mistake---it does seem like it works with --lazy-pages
. Thanks for the clarification!
I guess this makes the other question (regarding EINVAL) a little less relevant. I'm still not sure why I receive that error. This is the code. I have omitted all the definitions that were simply copied from the criu-ns script (e.g., _unshare
)
if _unshare(CLONE_NEWNS | CLONE_NEWPID) != 0:
_errno = ctypes.get_errno()
raise OSError(_errno, errno.errorcode[_errno])
criu_pid = os.fork()
if criu_pid == 0:
os.setsid()
_mount_new_proc()
os.execlp('criu', *['criu'] + ['restore','--lazy-pages', '-D', directory, '--tcp-established'])
This section is called twice. On the second call I get the error in the _unshare
call.
Hey :) Yeah, I'm not working on ns anymore. Removed my assignees from that page. Sorry for the confusion.
A friendly reminder that this issue had no activity for 30 days.
Hi.
I want to restore a process with a new PID (one that is not already taken). This can be done in a new namespace. The criu_ns script does a lot more, e.g., dump in a custom namespace, which I don't need. The criu_ns script does not seem to support lazy pages out of the box. The CRIU TODO (https://criu.org/Todo) lists this and already has an asignee (@efiop). Is this currently being worked on?
Thanks