Subject: Name Service switch... (WAS Re: bin/3011...)
To: Gordon W. Ross <gwr@mc.com>
From: Grey Wolf <greywolf@siva.captech.com>
List: current-users
Date: 12/11/1996 13:37:20
The point is made on establishing network info services in single-user
mode.  Since people are bringing up more and more services in
this discussion, and complaining about rebuilding libc.so
or not having access or whatever, perhaps it's time to migrate
net info services to a single daemon which handles the relevant cases and
only keep the hooks (plus file access) in libc.  This would expand
libc just a bit (for the alternate lookup code), but it could be helpful.

It would be a help for those systems which don't have shared libs.

I can see the downsides/comments already:

	"There's already daemons to handle that..."

	"Adding an extra layer would complicate things and undermine
	 reliability."

To which I would respond, yes, you're right.

BUT it means that you don't have to hard-code service lookups into
YP.  Just hang on to the file lookup routines (and possibly DNS
resolution for the hosts, for backward combatability).  Then you
could have your daemon which runs, looking for messages coming
in for certain requests.

The lookup code would do something like this:

if (lookup_resolv == LOOK_NET)
    if (ptr = get_daemon_lookup(req))	/* can't connect?  fall out of loop */
	return(ptr);
return ptr = lookup_in_files(req);

The upshot of this is that if something gets updated, all you need
to do is rebuild your daemon.  The time problem is the overhead of
seeing if the daemon is waiting on that port.  If it isn't, you won't
be able to connect, it'll drop instantly into the file lookup.

I'm certain I'm missing something, and it looks real ugly -- in fact
I'd rather just leave things alone.  But it might appease those within
the group who are bemoaning the fact that we don't have an nsswitch,
and that it doesn't help anyway for people who don't have a rtld.

Comments?




				--*greywolf;