March 29, 1996/date>
Motivation
Nanny provides a way to use system services without having to worry
about manually loading them or without having to load everything from
boot.
Overview
The nanny provides a demand-loading service for objects, such as
domains and devices, which have a nameserver representation. For each
named entity implemented by a dynamically linked server, nanny watches
for references to the entity and executes a script associated with the
name before the lookup is allowed to complete.
Nanny is an extension that is generally loaded at system boot time.
Using Nanny
Nanny can be used from the shell and directly from programs. Both interfaces
are described in the interface file.
We'll only describe the shell interface here.
- nanny install name script
- will execute "script" whenever anyone goes to lookup "name" in the name service.
- nanny stat
- shows all services currently being watched by nanny.
- nanny delete name
- removes name from nanny's purview.
- nanny touch service_name
- forces nanny to query service_name, executing any scripts that might be
required. (This is equivalent to "ns query name")
- nanny zap
- deinstall the current incarnation of nanny. (hackville USA)
An example
Here's an example that shows how to demand-load CAM whenever anyone
tries to mount a disk.
echo Enabling fs:ufs
nanny install fs:ufs ~/spin/user/fs/ufs/ALPHA_SPIN/ufs.rc
echo Enabling cam...
nanny install cam ~/spin/user/scripts/caminit.rc
ns install device:rz3a @cam
ns install device:rz3b @cam
ns install device:rz3c @cam
ns install device:rz3d @cam
ns install device:rz3h @cam
This says:
- if the device subsystem goes to look up rz3[a-h], then return
to it whatever happens when I follow @cam.
- Since cam is nanny'd to caminit.rc, all you have to do is
"mention" rz3a and you load cam.
- Cam will then install it's own device handles into the
nameserver forcing the ns install to be deleted.
Typically, when nanny loads a script for you, that script will
cause the name that nanny loaded to be changed in the
nameserver. This behavior will change.
bershad@cs.washington.edu