<div dir="ltr">Hello Andrew,<div><br></div><div>I don&#39;t have a precise use case.</div><div>I just wanted to test the CRIU live migration feature.</div><div><br></div><div>I thought it was possible to dump any level of the processes tree.</div>
<div>I mean if i wanted to migrate only the varnish process i thought it was feasable.</div><div><br></div><div>Actually i very new to namespaces i tried different levels of the following tree :</div><div><br></div><div><div>
init(1)-+-collectdmon(<b>12847</b>)---collectd(12849)-+-{collectd}(12854)</div><div>        |                                      |-{collectd}(12855)</div><div>        |                                      |-{collectd}(12856)</div>
<div>        |                                      |-{collectd}(12857)</div><div>        |                                      |-{collectd}(12858)</div><div>        |                                      `-{collectd}(12860)</div>
<div>        |-docker(<b>5802</b>)-+-lxc-start(<b>15502</b>)---sh(<b>15510</b>)-+-bash(15536)---sshd(16187)</div><div>        |              |                              |-cc-node(15674)---{cc-node}(15677)</div><div>        |              |                              |-collectdmon(15722)---collectd(15723)-+-{collectd}(15725)</div>
<div>        |              |                              |                                      |-{collectd}(15726)</div><div>        |              |                              |                                      |-{collectd}(15727)</div>
<div>        |              |                              |                                      |-{collectd}(15728)</div><div>        |              |                              |                                      |-{collectd}(15729)</div>
<div>        |              |                              |                                      `-{collectd}(15730)</div><div>        |              |                              |-rsyslogd(15546)-+-{rsyslogd}(15547)</div>
<div>        |              |                              |                 |-{rsyslogd}(15548)</div><div>        |              |                              |                 `-{rsyslogd}(15549)</div><div>        |              |                              |-ruby(15744)---{ruby}(17173)</div>
<div>        |              |                              `-varnishd(15694)---varnishd(15695)-+-{</div></div><div><br></div><div><br></div><div>i got different errors :<br><br></div><div><div>criu dump --tree<b> 15510</b> --images-dir /data --leave-stopped</div>
<div>(00.105553) Error (cr-dump.c:1472): A session leader of 15510(1) is outside of its pid namespace</div><div>(00.106356) Error (cr-dump.c:1811): Dumping FAILED.</div><div><br></div><div>criu dump --tree <b>15502</b> --images-dir /data --leave-stopped</div>
<div>(00.009229) Error (namespaces.c:155): Can&#39;t dump nested pid namespace for 15510</div><div>(00.009272) Error (namespaces.c:321): Can&#39;t make pidns id</div><div>(00.009546) Error (cr-dump.c:1811): Dumping FAILED.</div>
<div><br></div><div>criu dump --tree <b>5802</b> --images-dir /data --leave-stopped</div><div>(00.012216) Error (namespaces.c:155): Can&#39;t dump nested pid namespace for 15510</div><div>(00.012253) Error (namespaces.c:321): Can&#39;t make pidns id</div>
<div>(00.012553) Error (cr-dump.c:1811): Dumping FAILED.</div><div><br></div><div>criu dump --tree <b>12847</b> --images-dir /data --leave-stopped</div><div>(00.027698) Error (sk-inet.c:139): Connected TCP socket, consider using tcp-established option.</div>
<div>(00.027742) Error (cr-dump.c:1491): Dump files (pid: 12849) failed with -1</div><div>(00.028319) Error (cr-dump.c:1811): Dumping FAILED.</div></div><div><br></div><div>Maybe you could guide me, what kind of tests could i do please ?</div>
<div><br></div><div>Regards,</div><div>Smana</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/22 Andrew Vagin <span dir="ltr">&lt;<a href="mailto:avagin@parallels.com" target="_blank">avagin@parallels.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Smain,<br>
<div class="im"><br>
On Wed, Jan 22, 2014 at 10:06:12AM +0100, Smain Kahlouch wrote:<br>
&gt; Hello all and thank you for your answer.<br>
&gt;<br>
&gt; my &quot;unshare&quot; version doesn&#39;t support the same options as you<br>
<br>
</div>You can update util-linux from<br>
<a href="https://git.kernel.org/cgit/utils/util-linux/util-linux.git/" target="_blank">https://git.kernel.org/cgit/utils/util-linux/util-linux.git/</a><br>
<br>
BTW: Is your container is executed in a separate user namespace?<br>
<div class="im"><br>
&gt;<br>
&gt; unshare --help<br>
&gt;<br>
&gt; Usage:<br>
&gt;  unshare [options] &lt;program&gt; [args...]<br>
&gt;<br>
&gt; Options:<br>
&gt;  -h, --help        usage information (this)<br>
&gt;  -m, --mount       unshare mounts namespace<br>
&gt;  -u, --uts         unshare UTS namespace (hostname etc)<br>
&gt;  -i, --ipc         unshare System V IPC namespace<br>
&gt;  -n, --net         unshare network namespace<br>
&gt;<br>
&gt; Anyway i&#39;ll wait for a next criu version which will hopefully support<br>
&gt; namespaces :)<br>
<br>
</div>I thought a while and understood that I need more information about<br>
your use-case.<br>
<br>
CRIU supports pidns, but only if it&#39;s dumped with all tasks.<br>
<br>
e.g: &quot;criu dump --tree 4601&quot; will dump pidns and all processes of your<br>
LXC container.<br>
<br>
You try to dump a sub-tree of processes from CT, and you do this from the<br>
host system. In this case CT&#39;s pidns is an external resource.<br>
<br>
<a href="http://criu.org/What_cannot_be_checkpointed#External_resources" target="_blank">http://criu.org/What_cannot_be_checkpointed#External_resources</a><br>
<br>
Each external resource must be handled separately. And before adding<br>
support of one more type of external resources in CRIU, we want to be<br>
sure, that we have a real use-case for it.<br>
<br>
So could you describe your use-case in details?<br>
<br>
Thanks.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt;<br>
&gt; 2014/1/22 Andrew Vagin &lt;<a href="mailto:avagin@parallels.com">avagin@parallels.com</a>&gt;<br>
&gt;<br>
&gt;     On Tue, Jan 21, 2014 at 02:40:16PM +0100, Smain Kahlouch wrote:<br>
&gt;     &gt; Hello guys,<br>
&gt;     &gt;<br>
&gt;     &gt; I don&#39;t know if it&#39;s the right place to post this issue but I didn&#39;t find<br>
&gt;     &gt; another way to contact you.<br>
&gt;     &gt;<br>
&gt;     &gt; I&#39;m currently testing lxc features (&quot;docker&quot; to be precise) and I&#39;m<br>
&gt;     facing the<br>
&gt;     &gt; following message when I try to use criu :<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; 1 - check if CRIU is working with my kernel :<br>
&gt;     &gt;<br>
&gt;     &gt; criu check --ms<br>
&gt;     &gt; (00.012246) Warn  (tun.c:55): Skipping tun support check<br>
&gt;     &gt; Looks good.<br>
&gt;     &gt;<br>
&gt;     &gt; 2 - Identify what i want to dump, for example varnish:<br>
&gt;     &gt;<br>
&gt;     &gt; init,1<br>
&gt;     &gt;   ├─acpid,3886<br>
&gt;     &gt;   ├─atd,3648<br>
&gt;     &gt;   ├─auditd,3591<br>
&gt;     &gt;   │   ├─audispd,3593<br>
&gt;     &gt;   │   │   └─{audispd},3598<br>
&gt;     &gt;   │   └─{auditd},3592<br>
&gt;     &gt;   ├─cron,3781<br>
&gt;     &gt;   ├─dbus-daemon,3883 --system<br>
&gt;     &gt;   ├─docker,3732 -d -p /var/run/docker.pid -r=false -s devicemapper<br>
&gt;     &gt;   │   ├─lxc-start,4592 -n<br>
&gt;     &gt; 9f81f7bc33c83fc1369b9355c959b6f0d8c87c6758bb75af3ae726ba2bad053a -f...<br>
&gt;     &gt;   │   │   └─sh,4601 -c /bin/bash -c &#39;/usr/local/sbin/runservices.sh; /usr<br>
&gt;     /sbin/<br>
&gt;     &gt; sshd -D&#39;<br>
&gt;     &gt;   │   │       ├─bash,4685 -c /usr/local/sbin/runservices.sh; /usr/sbin/<br>
&gt;     sshd -D<br>
&gt;     &gt;   │   │       │   └─sshd,5022 -D<br>
&gt;     &gt;   │   │       ├─cc-node,4774 /usr/bin/cc-node -d -p /var/run/cc-node.pid<br>
&gt;     &gt;   │   │       │   └─{cc-node},4776<br>
&gt;     &gt;   │   │       ├─collectdmon,4820 -P /var/run/collectdmon.pid -- -C /etc/<br>
&gt;     &gt; collectd/collectd.conf<br>
&gt;     &gt;   │   │       │   └─collectd,4822 -C /etc/collectd/collectd.conf -f<br>
&gt;     &gt;   │   │       │       ├─{collectd},4823<br>
&gt;     &gt;   │   │       │       ├─{collectd},4824<br>
&gt;     &gt;   │   │       │       ├─{collectd},4825<br>
&gt;     &gt;   │   │       │       ├─{collectd},4826<br>
&gt;     &gt;   │   │       │       ├─{collectd},4827<br>
&gt;     &gt;   │   │       │       └─{collectd},4828<br>
&gt;     &gt;   │   │       ├─rsyslogd,4729 -c5<br>
&gt;     &gt;   │   │       │   ├─{rsyslogd},4737<br>
&gt;     &gt;   │   │       │   ├─{rsyslogd},4738<br>
&gt;     &gt;   │   │       │   └─{rsyslogd},4739<br>
&gt;     &gt;   │   │       ├─ruby,4837 /usr/bin/collectd-interface-daemon -p 5000 -l /<br>
&gt;     var/<br>
&gt;     &gt; log -P /var/run -I ...<br>
&gt;     &gt;   │   │       │   └─{ruby},7084<br>
&gt;     &gt;   │   │       └─varnishd,4792 -P /var/run/varnishd.pid -a :8000 -T :6082<br>
&gt;     -f /<br>
&gt;     &gt; etc/varnish/default.vcl -p ...<br>
&gt;     &gt;   │   │           └─varnishd,4794 -P /var/run/varnishd.pid -a :8000 -T<br>
&gt;     :6082 -f<br>
&gt;     &gt; /etc/varnish/default.vcl -p ...<br>
&gt;     &gt;   │   │               ├─{varnishd},4795<br>
&gt;     &gt;   │   │               ├─{varnishd},4796<br>
&gt;     &gt;   │   │               ├─{varnishd},4797<br>
&gt;     &gt;   │   │               ├─{varnishd},4798<br>
&gt;     &gt;   │   │               ├─{varnishd},4800<br>
&gt;     &gt;   │   │               ├─{varnishd},4801<br>
&gt;     &gt;   │   │               ├─{varnishd},4802<br>
&gt;     &gt;   │   │               ├─{varnishd},4803<br>
&gt;     &gt;   │   │               ├─{varnishd},4804<br>
&gt;     &gt;   │   │               ├─{varnishd},4805<br>
&gt;     &gt;   │   │               ├─{varnishd},4806<br>
&gt;     &gt;   │   │               ├─{varnishd},4807<br>
&gt;     &gt;   │   │               ├─{varnishd},4808<br>
&gt;     &gt;   │   │               ├─{varnishd},4809<br>
&gt;     &gt;   │   │               ├─{varnishd},4810<br>
&gt;     &gt;   │   │               ├─{varnishd},4811<br>
&gt;     &gt;   │   │               ├─{varnishd},4812<br>
&gt;     &gt;   │   │               └─{varnishd},4813<br>
&gt;     &gt;<br>
&gt;     &gt; 3 - try to dump<br>
&gt;     &gt;<br>
&gt;     &gt; criu dump --tree 4792 --images-dir /data/ --leave-stopped<br>
&gt;     &gt; pie: Error (pie/parasite.c:243): mount failed (-1)<br>
&gt;     &gt; pie: Error (pie/parasite.c:474): Close the control socket for writing<br>
&gt;     &gt; &gt;<br>
&gt;     &gt; (00.095409) Error (parasite-syscall.c:787): Can&#39;t retrieve FD from socket<br>
&gt;     &gt; (00.095454) Error (parasite-syscall.c:297): Message reply from daemon is<br>
&gt;     &gt; trimmed (12/0)<br>
&gt;     &gt; (00.095468) Error (cr-dump.c:1441): Can&#39;t get proc fd (pid: 4792)<br>
&gt;     &gt; (00.096172) Error (cr-dump.c:1811): Dumping FAILED.<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; I built a custom kernel from 3.12.6 debian sources.<br>
&gt;     &gt;<br>
&gt;     &gt; I followed the instructions in your website<br>
&gt;     &gt;<br>
&gt;     &gt; Could you please help me to fix that.<br>
&gt;<br>
&gt;     You are trying to dump a task from another pidns. Unfortunately it&#39;s<br>
&gt;     unsupported by now. I&#39;m going to fix that. I think it will not require too<br>
&gt;     much time. Thank you for the report.<br>
&gt;<br>
&gt;     Currently you can workaround this issue, if you enter in this pidns and<br>
&gt;     mount procfs in /proc.<br>
&gt;<br>
&gt;     unshare -m nsenter -p -t PID criu.sh<br>
&gt;<br>
&gt;     # cat criu.sh<br>
&gt;     set -e<br>
&gt;     mount -make-rprivate /<br>
&gt;     mount -t proc proc /proc<br>
&gt;     criu dump --tree PID --images-dir /data/ --leave-stopped<br>
&gt;<br>
&gt;     &gt;<br>
&gt;     &gt; Thanks,<br>
&gt;     &gt; Smana<br>
&gt;<br>
&gt;     &gt; _______________________________________________<br>
&gt;     &gt; CRIU mailing list<br>
&gt;     &gt; <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
&gt;     &gt; <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>