All of lore.kernel.org
 help / color / mirror / Atom feed
* C/R and stdio redirection
@ 2010-09-07 20:03 Sukadev Bhattiprolu
       [not found] ` <20100907200326.GA22256-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Sukadev Bhattiprolu @ 2010-09-07 20:03 UTC (permalink / raw)
  To: Oren Laadan, Dan Smith; +Cc: Containers, Nathan Lynch


Suppose we create a container and redirect its stdout/stderr as follows:

	lxc-execute -name foo -- /path/to/app > /tmp/xyz.out 2>&1

If we attempt to checkpoint the container 'foo', we fail bc one of the
fds in the application refers to /tmp/xyz.out, which is also in use
outside the container (specifically sys_checkpoint() fails due to the
"alien mount ns" check in ckpt_fill_fname()).

It can be argued, 'foo' is not a strict container (since it shares the
fd with another container).  For this reason, we currently need the
CHECKPOINT_SUBTREE flag in lxc-checkpoint.

We initially thought that solving mount-namespaces will solve this, but
realized that they are both separate problems. Mount-namespace C/R addresses
preserving the mounts within the container and /tmp/xyz.out is outside
the container.

So if an application container needs to redirect stdio as above, we should
either 
	a) disable/ignore the alien-mount-ns check or 

	b) try and start the application something like:

		$ cat /tmp/wrapper
		/path/to/app > /tmp/xyz.out 2>&1

		$ lxc-execute --name foo --  /tmp/wrapper

with the difference being /tmp/xyz.out is now inside the container's /tmp
filesystem rather than in the parent container.

Maybe we can go with approach 'a' above only if CHECKPOINT_SUBTREE is also
set - we had discussed this before and considered it hacky.

Or are there other solutions to this stdio redirection issue ?

Thanks,

Sukadev

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-10-06 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-07 20:03 C/R and stdio redirection Sukadev Bhattiprolu
     [not found] ` <20100907200326.GA22256-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-09-08  8:41   ` Louis Rilling
     [not found]     ` <20100908084152.GC4812-Hu8+6S1rdjywhHL9vcZdMVaTQe2KTcn/@public.gmane.org>
2010-09-08 10:00       ` Greg Kurz
2010-09-08 10:21         ` Louis Rilling
2010-09-08  9:44   ` Greg Kurz
2010-10-06  5:50     ` Sukadev Bhattiprolu
     [not found]       ` <20101006055017.GA22969-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-10-06  9:58         ` Louis Rilling
     [not found]           ` <20101006095835.GC30415-Hu8+6S1rdjywhHL9vcZdMVaTQe2KTcn/@public.gmane.org>
2010-10-06 13:43             ` Greg Kurz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.