Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbcCKWpr (ORCPT ); Fri, 11 Mar 2016 17:45:47 -0500 Received: from h-66-167-227-134.lsan.ca.dynamic.megapath.net ([66.167.227.134]:41990 "EHLO bifrost.lang.hm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752490AbcCKWpp (ORCPT ); Fri, 11 Mar 2016 17:45:45 -0500 X-Greylist: delayed 403 seconds by postgrey-1.27 at vger.kernel.org; Fri, 11 Mar 2016 17:45:45 EST Date: Fri, 11 Mar 2016 14:38:56 -0800 (PST) From: David Lang X-X-Sender: dlang@asgard.lang.hm To: Cole cc: Al Viro , LKML , "Austin S. Hemmelgarn" , Richard Weinberger Subject: Re: Variant symlink filesystem In-Reply-To: Message-ID: References: <56E327FF.1010103@nod.at> <56E3298A.1040008@nod.at> <56E32CD3.1010705@gmail.com> <20160311215106.GU17997@ZenIV.linux.org.uk> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2105 Lines: 47 On Sat, 12 Mar 2016, Cole wrote: > On 11 March 2016 at 23:51, Al Viro wrote: >> On Fri, Mar 11, 2016 at 10:52:52PM +0200, Cole wrote: >> >>> The implementation doesn't necessarily have to continue to work with >>> env variables. On FreeBSD, the variant symlinks function by using >>> variables stored in kernel memory, and have a hierarchical lookup, >>> starting with user defined values and terminating with global entries. >>> I am not aware of such functionality existing on linux, but if someone >>> could point me at something similar to that, I would much prefer to >>> use that, as there are issues with variables that are exported or >>> modified during process execution. >> >> Put your processes into a separate namespace and use mount --bind in it... > > This was one of the first solutions we looked at, and using various > namespaces. However we would like to be able to have multiple terminal > sessions open, and be able to have each session using a different > mount point, or be able to use the other terminals mount point, i.e. > switching the mount point to that of the other terminals. We would > also like the shell to be able to make use of these, and use shell > commands such as 'ls'. you should be able to have multiple sessions using the same namespace. There is the lwn.net series on namespaces at https://lwn.net/Articles/531114/ from what I'm looking at, this should be possible with the right mount options. It's not as trivial as setting an environment variable, but if it's all scripted, that shouldn't matter to the user. you would need to use the setns() call to have one session join an existing namespace rather than creating a new one. now, changing namespaces does require CAP_SYS_ADMIN, so if you are not running things as root, you may need to create a small daemon to run as root that reassigns your different sessions from one ns to another. David Lang > When we originally looked at namespaces and containers, we could not > find a solution to achieve the above. Is this possible using > namespaces? > > Regards > /Cole >