From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 28 Sep 2010 23:00:30 +0200 From: frank@inua.be To: 9fans@9fans.net Message-ID: <20100928210030.GA32478@chiron.galaxy> References: <20100926212108.GA20262@chiron.galaxy> <076604d7e2a8417033c7a50f4e7638c2@plug.quanstro.net> <20100927203314.GA12249@chiron.galaxy> <4c7c9f16dc13ac6970e1d78cd9a9c2f1@ladd.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4c7c9f16dc13ac6970e1d78cd9a9c2f1@ladd.quanstro.net> Subject: Re: [9fans] playing with namespaces Topicbox-Message-UUID: 5b92987c-ead6-11e9-9d60-3106f5b1d025 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