Advanced Namespace Tools blog 14 February 2017

Design for Independent /srv Namespaces

After a few years of pikeshedding discussions, I'm finally going to make an attempt to add multiple independent /srv namespaces to ANTS. There are two basic motivations, one technical, one social.

Once the feature is added, I expect the majority reaction will be "I said it's a dumb idea all along", with a minority opinion of "cool idea, but I think it should have been implemented differently." This is reasonable and to be expected.

Design for /srv Namespaces

Several different ideas for how this should work have been discussed. One idea, not identical but related, is having separate subdirectories within srv. Another idea is providing an attach specifier to the mount of srv. I'm going with something different: I'm copying the design of /env.

The main motivation for this is consistency. Plan 9, almost above all else, attempts to be internally consistent. As much as possible, the same mechanisms and interfaces should be reused whenever possible. Because of the precedent of the existing design of /env, I felt like it made the most sense to copy it as much as possible.

So: the plan is to add a new flag to rfork, to provide the option of receiving a new clean copy of a /srv device. I don't think there should be an option to receive a new copy of the parent srv, because unlike environment variables, the chans connected to files in /srv cannot be duplicated.

Implementation Plan

I believe this modification will require changes to the following five files:

Changes to make use of the modification in userspace should be limited to:

The goal is to make the minimal changes necessary, following the template of how envgrp is handled as much as possible.