List Info

Thread: location activation, part 2




location activation, part 2
user name
2008-04-24 19:56:11
As the earlier write-up on location activation makes clear,
there's
a bit of smf magic involved in the process.  I've tried to
come up
with an approach to doing this in the different cases where
locations
need to be activated:

1. On boot, when nwam is enabled
2. On boot, when legacy mode (network/physical:default) is
enabled
3. Switching from nwam to legacy mode (disable nwam, enable
default)
4. Switching from legacy to nwam mode
5. When nwam is running and needs to change location

I've described an approach in the following write-up.  As
always,
comments appreciated.

Thanks!
renee


Location-Related Configuration Data

The distinction between the legacy and NWAM repositories
becomes less
clear for Location configuration.  While NWAM has a distinct
repository
that stores Location settings, a Location is activated by
placing that
data into the standard file/service property used by the
legacy repository.
It will thus be necessary for NWAM to keep track of the
legacy Location
settings, which can be restored when switching to legacy
mode.


Location Activation

Activation of a location consists of two distinct phases:
    * Installation: configuration files are copied to the
well-known
      location, service properties are set
    * Instantiation: refresh/restart/enable the related SMF
services

When it activates a location, nwamd will explicitly perform
the
installation step; SMF service dependencies will be used to
perform
instantiation.

As installation of a location involves writing to the
filesystem, it
cannot be performed as early as network/physical.  Thus a
new service,
svc:/network/location will be introduced.  This service will
depend on
svc:/system/filesystem/usr; and a dependency on
svc:/network/location
will be added to each location-related service.  The new
service will
also depend on network/physical.

During boot, these dependencies will be sufficient to ensure
that things
happen in the correct order: the network elements will be
configured by
network/physical, the location data will be installed by
network/location
(installing the legacy location if network/physical:default
is enabled,
the no-net location if network/physical:nwam is enabled),
and then the
location-related services will come online with the
appropriate
configuration in place.

This sequence must also happen if NWAM is disabled and
legacy mode enabled,
or vice versa; and when NWAM is running and chooses to
change location. This
will be accomplished by giving the dependencies an
appropriate restart_on
attribute:

    * The dependency of network/location on network/physical
is a
      restart_on restart dependency.

    * The dependency of the location-related services on
network/location
      is a restart_on refresh dependency.

Thus if either the nwam or default instance of
network/physical is disabled,
network/location will be restarted, as will the
location-related services.
When NWAM is running and changes location, it will do so by
performing the
installation step, and then refreshing the network/location
service, which
will cause the location-related services to be restarted,
thus instantiating
the location.


Transition from NWAM mode to Legacy mode

When NWAM is disabled, it will perform a hard reset
shutdown; that is,
all links and interfaces will be torn down, and the No-Net
Location will
be activated.  Legacy mode can then be turned on by
enabling
network/physical:default; when network/location restarts
(due to its
restart_on restart dependency on network/physical), it will
install the
legacy location, which will then be instantiated as the
location-related
services are restarted due to their restart_on refresh
dependencies on
network/location.

Note that the record of the legacy location must be deleted
after it has
been installed; subsequent starts of the network/location
service (as on
reboot) should not change the location configuration if the
system remains
in legacy mode.


Transition from Legacy Mode to NWAM Mode

In order to minimize the changes to legacy mode behavior, no
changes will
be made to network/physical:default's existing stop method. 
Therefore,
the network configuration will not be modified at all when
that service
is stopped.  When NWAM is enabled, it will perform hard
reset behavior
(assuming that either NWAM has not been enabled since boot,
or that it
was stopped prior to legacy mode being enabled); this will
result in the
creation of the Legacy Location based on the current
settings, the
installation of the No-Net Location, and then a refresh of
the network/location
service to instantiate the No-Net Location.  As the active
NCP is instantiated,
the Location will be adjusted as needed, according to the
Location selection
logic; changes to the Location will result in additional
refreshes of the
network/location service.

_______________________________________________
nwam-discuss mailing list
nwam-discussopensolaris.org
http://mail.opensolaris.org/mailman/listinfo/nwam-discu
ss

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )