Documentation » Name Service Reconfiguration (SMF)
en

Name Service Reconfiguration (SMF)

Name Service Reconfiguration (SMF)

Authors:TH
Version:0.3
Date:2006-10-04
Status:DRAFT

Contents

1   Problem

Reconfiguration of all naming service components has to be done in synchronization with nscd(1M) which should be aware of reconfiguration of back-end components i.e. ldap_cachemgr(1M), ypbind(1M), nis_cachemgr(1M) etc. and possibly about

Specifically, nscd(1M) would benefit if it was notified of events such as back-end started, stopped, its reconfiguration started and finished.
We also want to make as little changes to other components of naming services subsystem code (except nscd(1M)) as possible. We will of course need to change service manifests for all components and possibly their methods (i.e. scripts in /lib/svc/method).

2   Solution

  As a solution to the this a simple utility program was proposed. This program is to be called from each particular method - start, stop and refresh - of corresponding services (ldap/client, nis/client etc.). and would (among other possible things) be responsible for sending notification to nscd(1M) through doors interface about the changes to particular back-end.

3   Implementation details

First, we need to implement nssadm_util program which will send notifications to nscd(1M) and which can (and possibly should only) be run from SMF methods. The basic syntax could be:

/usr/lib/nscd/nsutil
        {started|stopped|reconfig-started|reconfig-finished|failed}
        {ldap|dns|nis|nisplus|ads|etc.}

I propose to modify service manifest for network/dns/client, network/ldap/client, network/nis/client and (possibly) network/rpc/nisplus to call method script (which some of them do already) instead of directly point to daemon executable file:

71    <exec_method
72        type='method'
73        name='start'
74        exec='/usr/lib/ldap/ldap_cachemgr'
        ...

to

71    <exec_method
72        type='method'
73        name='start'
74        exec='/lib/svc/method/ns_ldapcachemgr start'
        ...

The script then might look like this (oversimplified):

...
case $1 in
'start')
        /usr/lib/ldap/ldap_cachemgr
        if [ $? = 0]; then
                /usr/lib/nscd/nsutil started ldap
        else
                /usr/lib/nscd/nsutil failed ldap
        fi
        ;;
'stop')
        /usr/lib/ldap/ldap_cachemgr -K
        /usr/lib/nscd/nsutil stopped ldap
        ;;
'refresh')
        /usr/lib/nscd/nsutil reconfig-started ldap
        /usr/lib/ldap/ldap_cachemgr -k
        if [ $? = 0]; then
                /usr/lib/nscd/nsutil reconfig-finished ldap
        else
                /usr/lib/nscd/nsutil failed ldap
        fi
        ;;
...

I propose adding new option -k (for lack of a better letter emoticon_wink) to ldap_cachemgr(1M) which will invoke configuration refresh and will be synchronous - i.e. the invocation of ldap_cachemgr won't finish until the configuration refresh process finishes (successfully or not). This is different from sending HUP signal to the daemon. Alternatively, we can stop and start ldap_cachemgr in the refresh method.

4   Other possible functionality

  Other possible functionality, which could go into the new utility nsutil is generating legacy configuration files from the profiles stored in repository. Since it's very easy to do it here we can have a releasable prototype very soon and we can post it to opensolaris.org for people to try out.

Tags:
Created by admin on 2009/10/26 12:13
Last modified by admin on 2009/10/26 12:13

XWiki Enterprise 2.7.1.34853 - Documentation