<div dir="ltr">The error that I get is:<div><br></div><div><div>(00.048051) 1: Error (files-reg.c:862): Can't open file dev/null on restore: No such file or directory</div></div><div><br></div><div>In my case, I think that files in /dev are manually created by Docker *after* the filesystem is set up. IOW, they are not part of the AUFS or UnionFS branches. When we dump the process, causing it to exit, the filesystem is dismantled. Right now, I am re-creating the filesystem before restore so I have to do the same thing that Docker does (i.e., creating /dev/null). Once there is native support in Docker for dump and restore, Docker itself would set up the filesystem before calling criu to restore, and this problem will go away.</div>
<div><br></div><div>Haven't had time to dig deeper. But does the above explanation make sense to you?</div><div><br></div><div>--Saied</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Thu, Aug 28, 2014 at 9:07 AM, Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">On 08/28/2014 07:43 PM, Saied Kazemi wrote:<br>
> I have seen a similar case where /dev/null is missing (Docker using UnionFS). While this patch fixes<br>
> the issue, I am wondering why the target file should be missing to start with and whether *always*<br>
> recreating missing target files could be masking more serious issues. Any thoughts?<br>
<br>
</div>+1 I'd also like to know the reasons why the mountpoint target doesn't exist.<br>
AFAIK rmdir/unlink doesn't work on dirs/files that are mountpoints.<br>
<br>
> --Saied<br>
<div class="">><br>
><br>
><br>
> On Thu, Aug 28, 2014 at 8:27 AM, Tycho Andersen <<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a> <mailto:<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a>>> wrote:<br>
><br>
> If the target of a bind mount doesn't exist, create it. In particular, this<br>
> happens with /dev/ptmx across hosts under LXC. We could also mkdir -p any path<br>
> to the target, although I'm not sure if that is a case that occurrs in the<br>
> wild.<br>
><br>
</div>> Signed-off-by: Tycho Andersen <<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a> <mailto:<a href="mailto:tycho.andersen@canonical.com">tycho.andersen@canonical.com</a>>><br>
<div><div class="h5">> ---<br>
> mount.c | 18 ++++++++++++++++++<br>
> 1 file changed, 18 insertions(+)<br>
><br>
> diff --git a/mount.c b/mount.c<br>
> index 9bb8a17..2108907 100644<br>
> --- a/mount.c<br>
> +++ b/mount.c<br>
> @@ -1346,6 +1346,24 @@ static int do_bind_mount(struct mount_info *mi)<br>
> root = rpath;<br>
> do_bind:<br>
> pr_info("\tBind %s to %s\n", root, mi->mountpoint);<br>
> +<br>
> + if (access(mi->mountpoint, F_OK)) {<br>
> + if (errno == ENOENT) {<br>
> + FILE *f;<br>
> +<br>
> + f = fopen(mi->mountpoint, "w");<br>
> + if (!f) {<br>
> + pr_perror("couldn't write 0 length %s", mi->mountpoint);<br>
> + return -1;<br>
> + }<br>
> +<br>
> + fclose(f);<br>
> + } else {<br>
> + pr_perror("Couldn't access %s", mi->mountpoint);<br>
> + return -1;<br>
> + }<br>
> + }<br>
> +<br>
> if (mount(root, mi->mountpoint, NULL,<br>
> MS_BIND, NULL) < 0) {<br>
> pr_perror("Can't mount at %s", mi->mountpoint);<br>
> --<br>
> 1.9.1<br>
><br>
> _______________________________________________<br>
> CRIU mailing list<br>
</div></div>> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a> <mailto:<a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a>><br>
> <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
><br>
> _______________________________________________<br>
> CRIU mailing list<br>
> <a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
> <a href="https://lists.openvz.org/mailman/listinfo/criu" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
><br>
<br>
</div></div></blockquote></div><br></div>