[CRIU] Containers with no /tmp

Pavel Emelyanov xemul at parallels.com
Thu Apr 2 11:55:04 PDT 2015


On 04/02/2015 09:12 PM, Saied Kazemi wrote:
> Hi Pavel and Andrew,
> 
> Because open_mountpoint() in mount.c creates a temporary directory in /tmp, I have
> run into an issue with containers that do not have /tmp.

:)

> In addition to open_mountpoint(), there are other places in CRIU that (of course
> reasonably) assume /tmp exists.

Well, yes. Can you share which places have you spotted? I've grepped the
sources, but only found on in mount.c. If you have already spent time finding
more it's perfectly worth not losing it :)

> To quickly work around this issue for now, I added mkdir("/tmp", 0777) right before
> calling mkdtemp(mnt_path), but wanted to get your thoughts on the right approach to
> this issue.  

Well, as far as the open_mountpoint is concerned, I think we can safely
create the temporary directory in / (which is set by switch_ns), since
the open_detach_mount() would rmdir one at the end.

> When it comes to containers, many assumptions (such as the existence of
> /tmp) won't hold anymore :)

Yes. We tried hard to avoid any assumptions about what can be there inside
container. Even the /proc is only assumed to exist in criu namespaces. But
it looks like some places got broken in that sense.

-- Pavel



More information about the CRIU mailing list