9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: frank@inua.be
To: 9fans@9fans.net
Subject: Re: [9fans] playing with namespaces
Date: Tue, 28 Sep 2010 23:00:30 +0200	[thread overview]
Message-ID: <20100928210030.GA32478@chiron.galaxy> (raw)
In-Reply-To: <4c7c9f16dc13ac6970e1d78cd9a9c2f1@ladd.quanstro.net>

On Mon, Sep 27, 2010 at 06:16:04PM -0400, erik quanstrom wrote:
> > - Why is it that, when the namespace is changed in
> >   /cfg/$sysname/cpurc, it does not seem to be taken into account by
> >   the aux/listen in /rc/bin/cpurc?
>
> dynamicly, or on reboot?

first reaction: I thought cpurc was only run when booting.

> > - Why can't a modified rc/bin/service.auth not be bound via
> >   /cfg/$sysname/namespace?
>
> $sysname is not set when cpurc is started.

first reaction: It is not set before /rc/bin/cpurc is started, but
/rc/bin/cpurc sets sysname in the very beginning, then possibly
executes /rc/bin/cpurc.local, then possibly executes
/cfg/$sysname/cpurc and then finally, possibly /cfg/$sysname/cpustart.

reading and thinking it over:

Booting: init -> newns -> uses /lib/namespace which also sources
/cfg/$sysname/namespace -> /rc/bin/cpurc -> ...

As $sysname is not yet known at the time, /cfg/$sysname/namespace
cannot be resolved yet (cpurc is not yet involved). Now I also
understand why you asked about "dynamically versus reboot". The lines
containing $sysname in /lib/namespace are there for changes to the
namespace after booting.

The different handling for service.auth and service is due to the fact
that listening for normal services is done as user none and that a new
namespace is created (using /lib/namespace but now $sysname can be
resolved).

This explains why /cfg/$sysname/namespace worked for service and not
for service.auth (no new namespace is created). So, to summarize:

- trusted services: no new namespace is created so cannot be handled
  by a namespace file

- normal services: a new namespace is created so has to be handled by
  a namespace file

Thanks for thinking along with me, even though I didn't do it the
traditional way in the first place (how could I know?). Now that I
understand these things (or at least hope so;-)), it's time to convert
it to the traditional way of doing it.


Kind regards,

> - erik

--
Frank Lenaerts ---------------------------------------- frank@inua.be




      reply	other threads:[~2010-09-28 21:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-26 21:21 frank
2010-09-26 21:41 ` erik quanstrom
2010-09-27 20:33   ` frank
2010-09-27 22:16     ` erik quanstrom
2010-09-28 21:00       ` frank [this message]

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=20100928210030.GA32478@chiron.galaxy \
    --to=frank@inua.be \
    --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).