<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Maximilian!<br>
<br>
Thank you for your question!<br>
Looks like your problem is a sub-problem of <a
href="http://criu.org/Applying_images">applying images on a
working </a><br>
<a href="http://criu.org/Applying_images">process</a>, which I'm
currently trying to solve. I'm on some initial stages of solving,<br>
without any submitted code yet. It's planned to add "apply"
request to RPC after.<br>
<br>
On 24.04.2014 16:29, Maximilian Kleber wrote:<br>
</div>
<blockquote
cite="mid:611AC132-C05B-48C0-9995-95733E0BB8D0@stud.uni-saarland.de"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hello everybody,
<div><br>
</div>
<div>I’m currently working with CRIU as a part of my bachelor
thesis.</div>
<div>One of the ideas is to provide CRIU access via a library
approach for Java applications.</div>
<div><br>
</div>
<div>For this I’m using the provided C Library and JNI.</div>
<div><br>
</div>
<div>One of the goals is that an application can checkpoint and
restore itself. </div>
<div>To be able to restore itself later, I’ll set the
leave_running option when issuing the checkpoint request (I know
this should be avoided, but elsewise this feature does not make
much sense).</div>
<div><br>
</div>
<div>Checkpointing, restoring via command line or restoring an
older session within the application works. But I can’t
checkpoint and then restore this checkpoint directly afterwards.
I guess CRIU tries to restore the original PID but since the
original application is still running, this results in a
conflict and a restoring failure. </div>
<div><br>
</div>
<div>So I guess process duplication is not possible but <i>is
there a way an application can replace itself with an older
checkpoint of the same execution session?</i></div>
<div><br>
</div>
<div>I already tried to fork a child before restoring the
application and within this child I kill the parent process and
restore then the older checkpoint, which seems to work fine but
I can only work if the child has no other siblings, since then
the PID conflicts occur again.</div>
<div>Another issue is, that killing an application does not always
terminate the application instantly, I have to somehow wait for
the process to terminate. Another idea was to send the kill
signal to the whole process group to reach all child processes
but this would also affect the forked child which I need to
restore the application once all processes have been terminated.
Maybe I find a way to somehow detach the forked child from the
parent and the whole process group.</div>
<div><br>
</div>
<div>I would be glad if anyone has an idea how to solve the
problem of self-restoring. Any comments are welcome!</div>
<div><br>
</div>
<div>Thank you in advance!</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Maximilian Kleber</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
CRIU mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CRIU@openvz.org">CRIU@openvz.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openvz.org/mailman/listinfo/criu">https://lists.openvz.org/mailman/listinfo/criu</a>
</pre>
</blockquote>
<br>
</body>
</html>