9front - general discussion about 9front
 help / color / mirror / Atom feed
* Surprise insertion of bind into namespace (anecdote)
@ 2013-09-13 11:01 Ethan Grammatikidis
  2013-09-13 19:13 ` [9front] " Ethan Grammatikidis
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Grammatikidis @ 2013-09-13 11:01 UTC (permalink / raw)
  To: 9front

Just noting a surprise I had with namespaces. I fixed my usage, but
thought it so surprising it ought to be shown for other namespace newbs
to see.

I wanted to bind /n/other/usr/ethan on /usr/ethan so that all dirs and
files in the former appeared in the latter; not just tmp. To do this I
simply changed the bind in $home/lib/profile, removing the "/tmp" from
both args as shown in line 4 below. 

lib/profile:
1       bind -b $home/bin/rc /bin
2       bind -b $home/bin/$cputype /bin
3       mount -qC /srv/boot /n/other other
4       bind -qa /n/other/usr/$user $home
5       bind -c $home/tmp /tmp
ns output:
1       bind -b /usr/ethan/bin/rc /bin 
2       bind -b /usr/ethan/bin/386 /bin 
3       mount -C '#s/boot' /n/other other
	bind  /usr/ethan /usr/ethan                             ←
	unrequested; breaks my namespace
4       bind -a /n/other/usr/ethan /usr/ethan 
5       bind -c /n/other/usr/ethan/tmp /tmp 

I got my dirs from /n/other, I could read and write existing files as
normal, but I could no longer create files in $home! I assumed binding
with -a would leave the original dir unaffected, but this was false.
That extra line in ns output, "bind /usr/ethan /usr/ethan", shows the
system doesn't follow this assumption; as soon as I made /usr/ethan a
mount point it implicitly lost create permissions. The fix was simple:
add "bind -bc $home $home" before line 4. Ns still shows the unrequested
bind, it appears before the "bind -bc", but apparently the -c in "bind
-bc" overrides it.

In brief: binding over a dir which is not already a mountpoint
implicitly removes create permission from that dir. Add a "bind -c $dir
$dir" to restore create permission.


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

* Re: [9front] Surprise insertion of bind into namespace (anecdote)
  2013-09-13 11:01 Surprise insertion of bind into namespace (anecdote) Ethan Grammatikidis
@ 2013-09-13 19:13 ` Ethan Grammatikidis
  2013-09-13 19:17   ` Ethan Grammatikidis
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Grammatikidis @ 2013-09-13 19:13 UTC (permalink / raw)
  To: 9front

On Fri, Sep 13, 2013, at 12:01 PM, Ethan Grammatikidis wrote:
> add "bind -bc $home $home" before line 4. Ns still shows the unrequested
> bind, it appears before the "bind -bc",

An unfortunate side effect of this work-around is wildcards in the shell
will give two copies of any matches. I've taken to using wildcards
instead of relying on completion, and this is proving rather intrusive.
I just added filename deduplication to my editor-launch script, which is
a little crazy.


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

* Re: [9front] Surprise insertion of bind into namespace (anecdote)
  2013-09-13 19:13 ` [9front] " Ethan Grammatikidis
@ 2013-09-13 19:17   ` Ethan Grammatikidis
  0 siblings, 0 replies; 3+ messages in thread
From: Ethan Grammatikidis @ 2013-09-13 19:17 UTC (permalink / raw)
  To: 9front

On Fri, Sep 13, 2013, at 08:13 PM, Ethan Grammatikidis wrote:
> On Fri, Sep 13, 2013, at 12:01 PM, Ethan Grammatikidis wrote:
> > add "bind -bc $home $home" before line 4. Ns still shows the unrequested
> > bind, it appears before the "bind -bc",
> 
> An unfortunate side effect of this work-around is wildcards in the shell
> will give two copies of any matches. I've taken to using wildcards
> instead of relying on completion, and this is proving rather intrusive.
> I just added filename deduplication to my editor-launch script, which is
> a little crazy.

and i just thought to wonder, if i bound /n/other/usr onto /usr instead
of trying to use $home as a mountpoint, would i have any of this fuss?
it would have the advantage of also putting glenda's tmp into the
expected place. not trying it just yet, done enough namespace fussing
for the day.


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

end of thread, other threads:[~2013-09-13 19:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13 11:01 Surprise insertion of bind into namespace (anecdote) Ethan Grammatikidis
2013-09-13 19:13 ` [9front] " Ethan Grammatikidis
2013-09-13 19:17   ` Ethan Grammatikidis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).