public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* /etc/mtab and per-process namespaces
@ 2005-10-02 22:08 David Leimbach
  2005-10-04 19:14 ` David Leimbach
  2005-10-20  3:42 ` Rob Landley
  0 siblings, 2 replies; 24+ messages in thread
From: David Leimbach @ 2005-10-02 22:08 UTC (permalink / raw)
  To: Linux Kernel

I've been just playing around with the v9fs work and private
namespaces from yesterday's [October 1, 2005] top of tree from Linus'
git archive and I was looking at /etc/mtab's reaction to having
multiple namespaces with bind mounts.

I have a directory ("slash") and bind it to "/" in a new namespace
created with a clone call.  /etc/mtab then has a line appended to it
for this bind.

/ /home/dave/slash none rw,bind 0 0

Then in the "global default" namespace I do the same thing.  This adds
yet another line to my /etc/mtab with exactly the same contents.

I then exited both shells and /etc/mtab is left with both lines:

/ /home/dave/slash none rw,bind 0 0
/ /home/dave/slash none rw,bind 0 0

Did I just "leak" a namespace or is mtab just way off from reality now?

Also, if I check the procfs it seems to have no record of either of
these binds ever occurring.  [/proc/mounts]

Also, does it make sense to even think about adding a pid column
number for the "private" namespaces or perhaps just to mark it as
"priv" or something to that effect.

It's not clear to me what the best way to deal with this would be. 
Right now it appears to be broken or at least very inconsistent.

I can think of a lot of ways to use private namespaces to avoid
conflicts with software installations... much like the DragonFlyBSD
folks use variant symlinks to have two-level data about what version
of libx libx.so links to.  I just think private namespaces make this a
bit more elegant to handle, especially in the context of Xen and
upcoming virtualization hardware from Intel and AMD.  As such I find
this feature of linux [and Plan 9/Inferno - where it came from] to be
pretty important.


- Dave

^ permalink raw reply	[flat|nested] 24+ messages in thread
[parent not found: <4TkbZ-6KJ-9@gated-at.bofh.it>]
* Re: /etc/mtab and per-process namespaces
@ 2005-10-22 13:23 Dr. Greg Wettstein
  2005-10-29  0:06 ` Ram Pai
  0 siblings, 1 reply; 24+ messages in thread
From: Dr. Greg Wettstein @ 2005-10-22 13:23 UTC (permalink / raw)
  To: Mike Waychison, Ram; +Cc: Linux Kernel, leimy2k

On Oct 13,  7:10pm, Mike Waychison wrote:
} Subject: Re: /etc/mtab and per-process namespaces

Good morning to everyone, really behind on e-mail, my apologies for
joining the thread late.

> Ram wrote:
> > On Tue, Oct 04, 2005 at 12:14:47PM -0700, David Leimbach wrote:
> > 
> >>Hmm no responses on this thread a couple days now.  I guess:
> >>
> >>1) No one cares about private namespaces or the fact that they make
> >>/etc/mtab totally inconsistent.
> >>2) Private Namespaces aren't important to anyone and will never be
> >>robust unless someone who cares, like me, takes it over somehow.
> >>3) Everyone is busy with their own shit and doesn't want to deal with
> >>me or mine right now.
> >>
> >>I'm seriously hoping it's 3 :).  2 Is acceptable too of course.  I
> >>think this is important and I want to know more about the innards
> >>anyway.  1 would make me sad as I think Linux can really show other
> >>Unix's what-for here when it comes to showing off how good the VFS can
> >>be.

> Or,  you bite the bullet and fix /proc/mounts and let distributions bind 
> mount /proc/mounts over /etc/mtab.
> 
> Sun recognized this as a problem a long time ago and /etc/mnttab has 
> been magic for quite some time now.
> 
> Add to this the fact that a textfile /etc/mtab is busted because it's 
> whitespace seperated and pieces blows up and you do things like:
> 
> mount filer:/export/mikew "/home/Mike Waychison"

As to the three options above, I believe number 3 would be operative.
Private namespaces are extremely useful concepts, we are growing
increasingly dependent on them for systems management and
administration.  I believe the issue is a chicken/egg problem, without
an update in tools the concept of namespaces are less approachable
than they should be.

Mike's comments are very apt.  The current situation with mount
support is untenable.  Even working on private development machines it
gets confusing as to what is or is not mounted in various
shells/processes.  The basic infra-structure is there with process
specific mount information (/proc/self/mounts) but mount and friends
are a bit problematic with respect to supporting this.

I'm working on a namespace toolkit to address these issues.  I've got
a pretty basic tool, similar to sudo, which allows spawning processes
with a protected namespace.  I'm adding a configuration system which
allow systems administrators to define a setup of bind mounts which
are automatically executed before the user is given their shell.  I'm
also working up a PAM account module to go along with this.  I would
certainly be open to suggestions as to what else people would consider
useful in such a toolkit.

I've been pondering the best way to take on the mount problem.
Current mount binaries seem to fall back to /proc/mounts if /etc/mtab
is not present.  All bets are off of course if the mount binary is
used for the bind mount since a new /etc/mtab is created.

I'm willing to whack on the mount binary a bit as part of this.  The
obvious solution is to teach mount to act differently if it is running
in a private namespace.  If anybody knows of a good way to detect this
I would be interested in knowing that.  In newns (the namespace sudo
tool) I'm setting an environment variable for mount to detect on but a
system level approach would be more generic.

The other problem is the information exported in /proc/mounts.  It
would seem problematic to modify its format but in order to serve as a
useful source of information for a modified mount binary it would need
to contain mount option information.  Since this is definitely process
specific information it would seem to call for something in /proc
rather than /sysfs.  Do we need a new pseudo-file?

I would be certainly interested in peoples reflections on this.  When
I get something a bit more shaken down I will roll up a preliminary
distribution and announce it.

> Mike Waychison

Best wishes for a pleasant weekend to everyone.

Greg

}-- End of excerpt from Mike Waychison

As always,
Dr. Greg 'GW' Wettstein
------------------------------------------------------------------------------
                         The Hurderos Project
         Open Identity, Service and Authorization Management
                       http://www.hurderos.org

^ permalink raw reply	[flat|nested] 24+ messages in thread
[parent not found: <50rBX-76N-37@gated-at.bofh.it>]

end of thread, other threads:[~2005-11-01  8:45 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-02 22:08 /etc/mtab and per-process namespaces David Leimbach
2005-10-04 19:14 ` David Leimbach
2005-10-04 19:18   ` Christoph Hellwig
2005-10-04 19:49     ` Michael Tokarev
2005-10-04 19:52     ` David Leimbach
2005-10-04 19:43   ` Al Viro
2005-10-04 20:07     ` David Leimbach
2005-10-04 20:20       ` Al Viro
2005-10-05 16:29   ` Ram
2005-10-14  2:10     ` Mike Waychison
2005-10-17  0:47       ` Ian Kent
2005-10-20  3:53         ` Rob Landley
2005-10-20  3:42 ` Rob Landley
     [not found] <4TkbZ-6KJ-9@gated-at.bofh.it>
     [not found] ` <4U0uy-33E-7@gated-at.bofh.it>
     [not found]   ` <4U0XK-3Gp-47@gated-at.bofh.it>
2005-10-04 21:20     ` Bodo Eggert
2005-10-05  0:14       ` Al Viro
  -- strict thread matches above, loose matches on Subject: below --
2005-10-22 13:23 Dr. Greg Wettstein
2005-10-29  0:06 ` Ram Pai
2005-10-29 10:16   ` Rob Landley
2005-10-31 19:11     ` Ram Pai
2005-10-31 23:27       ` Rob Landley
2005-11-01  0:01         ` Ram Pai
2005-11-01  7:36         ` Miklos Szeredi
2005-11-01  8:44           ` Rob Landley
     [not found] <50rBX-76N-37@gated-at.bofh.it>
     [not found] ` <50rBX-76N-35@gated-at.bofh.it>
2005-10-22 17:26   ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox