On Tue, Dec 23, 2008 at 02:29:13PM -0500, James Carlson wrote:
> Renee Danson writes:
> > On Tue, Dec 23, 2008 at 01:47:04PM -0500, James Carlson wrote:
> > > Isn't network/location enabled by default on the first boot?  If it
> > > is, then this problem shouldn't occur: nwamd will start, but be unable
> > > to do anything until network/location runs.  Once it does run, it'll
> > > set up the default locations, and nwamd can then choose one and
> > > restart network/location.
> > 
> > The problem is that we had to make things a little more complex.  A
> > couple components of the location are files that must reside in well-
> > known locations in the filesystem, and thus a location cannot be
> > installed until we have a writable filesystem (after nwam starts),
> > allowing those files to be copied into place.
> > 
> > So the plan was for nwamd to put the files in a relay directory (under
> > /etc/svc/volatile, which is writable very early, when nwam starts) as
> > soon as it has selected a location to install/activate.  network/location
> > depends on filesystem/usr (so it will have the writable filesystem) and
> > on nwamd having placed files under /etc/svc/volatile.  So network/location
> > can't run until nwamd has chosen a location, but on that first boot, nwamd
> > can't choose a location until network/location has run (assuming that the
> > user has not yet created any locations, which seems likely).
> 
> If nwamd hasn't chosen something, shouldn't network/location just go
> ahead with some default, such as "no network?"
> 
> Or is that too simple?

Oh, way too simple, of course.  :-)

Actually, it might be, or it might not.  How would this work?

The nwam service would be started, which would in turn start nwamd.  When
nwamd's location-selection logic decides it has a location ready, it writes
any needed files out to /etc/svc/volatile, which it can do at any time.  It
then refreshes network/location, which, if it is already up and running,
will run its refresh method, which will finish installing and then activate
the location.  If network/location is not yet running, the refresh will have
no effect.

Independently, network/location will be started when filesystem/usr is
online.  The first thing it will do is create the default locations, if
needed.  It will then check for a location that nwamd wants to be installed,
and finish installing and activate if that's present.  If not, it will
install and activate the No-Net location.

It's that last line that worries me.  There's a lot of grunginess required
to install a location (which, incidentally, will disappear when locations
can be instances of enhanced smf profiles), and that grunginess mostly
lives in nwamd.  Replicating it in network/location's start method feels
even more grungy.

I suppose, though, that it (the location installation grunginess) doesn't
have to live in nwamd.  Especially considering that we hope it will be
going away soon.  We could write a script or c program that does it, and
then that could be called from either nwamd or network/location's start or
refresh method.  That script or c program could then be replaced once we
have smf infrastructure to activate an enhanced profile.

Does that sound reasonable?  Simple enough?

-renee

Reply via email to