From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: Linux Containers <containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org>
Subject: Re: [PATCH] Restore task fs_root and pwd (v2)
Date: Tue, 29 Dec 2009 13:01:35 -0600 [thread overview]
Message-ID: <20091229190135.GA12966@us.ibm.com> (raw)
In-Reply-To: <20091229025846.GA16492-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Quoting Serge E. Hallyn (serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> Quoting Serge E. Hallyn (serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> > Checkpoint and restore task->fs. Tasks sharing task->fs will
> > share them again after restart.
>
> Sigh. Shoulda written testcases in advance :) pwd restoration
> is fine. And technically root restoration is fine too. If any
> task which is not the container init did a chroot, the chroot is
> restored. However, the container init is chrooted (whether it
> was started using 'chroot app' or did a chroot() when it started
> up), then restart fails because the executable filename is relative
> to the chroot (i.e. /fssleep instead of /root/cr_tests/taskfs/tmp/fssleep),
> and isn't found.
Sorry, didn't say that right. Executable filename being relative to
chroot isn't the problem, the problem is that the we get the filename
of the container init's root relative to... the container init's root,
so we chroot to /.
I've been trying to figure out how to properly solve it - assuming it
needs solving.
The most likeable solution imo would be to have the kernel put the
pathname of the container root in the container configuration section
of the checkpoint image. Then have user-cr/restart.c chroot to that
location before forking the rest of the container. Having kernel do
the chroot is not as pretty bc each task will have to do it in its
own sys_restart(), and then may have to chroot again to its private
chroot.
The problem with the above is: save the container chroot relative
to what? Relative to its parent? It may have been reparented to
init. Relative to the checkpointer? It may actually be sitting in
its own chroot such that there may be no path from its root to the
root of the container.
So another thing we can do is to ignore the container chroot in the
kernel altogher, and provide an option to have user-cr/checkpoint
try to save the value of `readlink /proc/$container_init/root`,
and have restart chroot to that if it was stored.
That however doesn't help if a chrooted task is doing a
self-checkpoint.
-serge
next prev parent reply other threads:[~2009-12-29 19:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-28 18:39 [PATCH] Restore task fs_root and pwd (v2) Serge E. Hallyn
[not found] ` <20091228183948.GA19788-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-12-29 2:58 ` Serge E. Hallyn
[not found] ` <20091229025846.GA16492-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-12-29 19:01 ` Serge E. Hallyn [this message]
2010-01-20 20:28 ` Oren Laadan
[not found] ` <4B57675D.8080609-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-01-20 20:47 ` Oren Laadan
[not found] ` <4B576BF3.9030506-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-01-20 20:55 ` Oren Laadan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091229190135.GA12966@us.ibm.com \
--to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
--cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.