From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: Alex Musolino Date: Tue, 24 Oct 2017 13:24:14 +0930 In-Reply-To: 964A8DDC-CA86-4EDD-9985-D0C5751FF55E@gmail.com MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Backgrounding a task Topicbox-Message-UUID: c3e630d4-ead9-11e9-9d60-3106f5b1d025 > 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