From: "Daniel P. Berrange" <berrange-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "Eric W. Biederman" <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: Virtualizing /proc/sys/kernel/random/boot_id per container ?
Date: Wed, 5 Sep 2012 13:10:59 +0100 [thread overview]
Message-ID: <20120905121058.GB21383@redhat.com> (raw)
In-Reply-To: <87vcft1shu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
On Tue, Sep 04, 2012 at 12:46:05PM -0700, Eric W. Biederman wrote:
> "Serge E. Hallyn" <serge-A9i7LUbDfNHQT0dZR+AlfA@public.gmane.org> writes:
>
> > Quoting Glauber Costa (glommer-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org):
> >> Not all files provided by the kernel are "per-kernel". /proc/self is
> >> full of per-namespace stuff.
> >>
> >> >> The way I see it, every file we need to setup from the outside is a
> >> >> hassle. Among many other things, it is just asking for duplication of
> >> >> efforts among multiple userspaces.
> >> >>
> >> >> netns does this for its proc files. The only reason we don't do it for
> >> >> cgroups-driven file, is that the semantics is very ill-defined. For this
> >> >> file, it doesn't seem to be the case.
> >> >
> >> > But it is the case. How do you intend to have the kernel decide what
> >> > value to put in there for a process in a container, or in a chroot?
> >> >
> >>
> >> one value per pidns.
> >
> > ok. (So should it be called /proc/pidns_uuid? Well, whatever. No
> > objection from me - thanks.)
>
> /proc/sys/kernel/boot_id.
>
> Someday we will get the plumbing right in the kernel so that can be
> /proc/sys -> /proc/self/sys and /proc/self/sys/kernel/boot_id
>
> The origin of boot_id was so that emacs could implement distributed
> locking in userspace by creating a symlink from .#filename to
> user-WI0L6dQK/Vr7saj2s7cPmQ@public.gmane.org:boot_id.
>
> Ultimately emacs opted to just stat /var/run/random-seed or to grovel
> through utmp or wtmp to find the last boot record.
>
> Of course /var/run/random-seed is now named something like
> /var/lib/urandom/random-seed as distributions continue their relentless
> pursuit to break userspace.
>
> But ultimately boot_id was defined as something you can use to detect
> stale pids and stale lockfiles. Since the original definition was
> a uuid to detect stale pids, that seems a reasonable justification
> for keeping it in the pid_namespace. Boot_id isn't the best name in
> that case but shrug.
Ok, so reading through this thread, my understanding is that any patch
for this needs to work as follows:
- Associate '/proc/sys/kernel/random/boot_id' with the pid namespace
- Allow boot_id to be written to, only if it has not yet been
read in the current pid namespace. (for migration use case)
- Lazy generate a UUID for boot_id on first read in the current pid
namespace, only if it has not previously been written to.
- Add file to Documentation/ explaining the use case for the boot_id
file and its semantics wrt to namespaces.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2012-09-05 12:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-30 21:18 Virtualizing /proc/sys/kernel/random/boot_id per container ? Daniel P. Berrange
[not found] ` <20120830211832.GA3297-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-30 22:15 ` Eric W. Biederman
[not found] ` <878vcwjabu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-08-30 22:50 ` Daniel P. Berrange
[not found] ` <20120830225002.GA9226-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-31 0:13 ` Eric W. Biederman
[not found] ` <87bohrhqai.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-03 7:56 ` Glauber Costa
[not found] ` <5044629C.3030909-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-03 19:48 ` Eric W. Biederman
[not found] ` <87r4qi6g6k.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-04 8:42 ` Glauber Costa
[not found] ` <5045BF05.9050707-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-04 9:16 ` Glauber Costa
[not found] ` <5045C707.9020001-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-04 9:53 ` Eric W. Biederman
2012-09-04 9:20 ` Eric W. Biederman
[not found] ` <878vcq5ekx.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-04 12:08 ` Daniel P. Berrange
2012-09-04 15:28 ` Serge Hallyn
2012-09-04 14:44 ` Serge Hallyn
2012-09-04 14:45 ` Glauber Costa
[not found] ` <50461421.7030305-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-04 15:25 ` Serge Hallyn
2012-09-04 15:31 ` Glauber Costa
[not found] ` <50461EBB.2050501-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-04 17:18 ` Serge E. Hallyn
[not found] ` <20120904171818.GA5334-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2012-09-04 19:46 ` Eric W. Biederman
[not found] ` <87vcft1shu.fsf-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
2012-09-05 12:10 ` Daniel P. Berrange [this message]
2012-09-05 7:59 ` Glauber Costa
2012-08-30 23:22 ` Daniel P. Berrange
[not found] ` <20120830232239.GE9226-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-08-31 0:18 ` Eric W. Biederman
2012-08-31 13:25 ` Serge Hallyn
2012-09-03 7:53 ` Glauber Costa
[not found] ` <504461F1.1090400-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
2012-09-04 14:42 ` Serge Hallyn
2012-09-03 7:52 ` Glauber Costa
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=20120905121058.GB21383@redhat.com \
--to=berrange-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@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.