9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Alex Musolino <alex@musolino.id.au>
To: 9fans@9fans.net
Subject: Re: [9fans] Backgrounding a task
Date: Tue, 24 Oct 2017 13:24:14 +0930	[thread overview]
Message-ID: <CB98AF4C4EE9B10A5E9653C009962695@musolino.id.au> (raw)
In-Reply-To: 964A8DDC-CA86-4EDD-9985-D0C5751FF55E@gmail.com

> So far, it looks like the closest equivalent is to draw a new window
> and inherit the namespace of the original one by reading the namespace
> from the proc.

The problem with /proc/$pid/ns is entries that can't be "replayed".
For example, the following command will not work:

	mount -b '#|/data' /mnt

Nor does it provide any real indication as to what exactly is hooked
up to the other end of the 9P pipe.

> I wonder if there could be a Rio gesture to draw a new window
> inheriting the namespace of the window I pick by clicking.

Rio can't access the namespaces of the processes running in its
windows.  The -m option to window(1) works by rforking a new process
with the RFNAMEG flag set and then doing the appropriate mounting and
binding to create and use a new rio window.

Some months ago I played with the idea of adding support for an
"nsjoin" command to the /proc/$pid/ctl file.  This allowed you to join
the namespace of another process a little something like this:

	term% ps | grep plumber
	alex            670    0:00   0:00      864K Pread    plumber
	alex            671    0:00   0:00      864K Rendez   plumber
	term% echo nsjoin 670 >/proc/$pid/ctl
	term%

Subsequent changes to the namespace would affect the plumber.  If you
wanted a copy, just do 'rfork n' after joining the namespace.

Of course, a lot of the isolation that per-process namespaces give you
is suddenly undone by the introduction of this facility.  At this
point I'm not entirely convinced that it's worth the trouble.

--
Cheers,
Alex Musolino




             reply	other threads:[~2017-10-24  3:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24  3:54 Alex Musolino [this message]
2017-10-24 11:19 ` Chris McGee
  -- strict thread matches above, loose matches on Subject: below --
2017-10-24 14:21 Alex Musolino
2017-10-24 19:18 ` Giacomo Tesio
2017-10-24 22:07   ` Giacomo Tesio
2017-10-24 23:00 ` Chris McGee
2017-10-24 23:13   ` Giacomo Tesio
2017-10-06 23:33 Chris McGee
2017-10-07  1:42 ` Erik Quanstrom
2017-10-07  4:04 ` Skip Tavakkolian
2017-10-07 12:21   ` Chris McGee
2017-10-23 17:20     ` Yaroslav Kolomiiets
2017-10-24  1:48       ` Chris McGee

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=CB98AF4C4EE9B10A5E9653C009962695@musolino.id.au \
    --to=alex@musolino.id.au \
    --cc=9fans@9fans.net \
    /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 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).