[CRIU] Containers with no /tmp

Saied Kazemi saied at google.com
Fri Apr 3 15:53:47 PDT 2015


On Thu, Apr 2, 2015 at 11:55 AM, Pavel Emelyanov <xemul at parallels.com>
wrote:

> 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 :)
>

I checked again and noticed that all other explicit references to /tmp are
in test programs.  So you're right, there's only one place in CRIU proper.


> 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.
>

I agree.  Will send a patch that uses / if /tmp fails.



> > 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.
>

I am beginning to work with some more "interesting" containers.  Will note
if and how they break any assumptions and let you know.



>
> -- Pavel
>
> --Saied
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150403/ec1afd54/attachment.html>


More information about the CRIU mailing list