HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
3 Configuring plug-ins
After you compile your server plug-in, you need to configure the HP-UX Directory Server so
that it correctly loads your plug-in. The following sections describe this process.
3.1 Creating a plug-in configuration file
To add your plug-in to the Directory Server configuration, you need to create an LDIF
representation of your plug-in entry, add the plug-in entry to the Directory Server configuration,
and reload the server configuration. This section illustrates how to create your plug-in entry.
“Loading the plug-in configuration file” explains how to add the plug-in entry to the Directory
Server configuration and reload the server configuration.
The plug-in configuration file must be an LDIF file written in ASCII format. The following listing
shows the contents of an example plug-in configuration file. Line numbers have been added for
ease of reference; do not number the lines in your own LDIF file.
An example plug-in configuration file
1. dn: cn=Example Plug-in,cn=plugins,cn=config
2. objectclass: top
3. objectclass: nsSlapdPlugin
4. objectclass: extensibleObject
5. cn: Example Plug-in
6. nsslapd-pluginpath: /opt/dirsrv/lib/plugins/test-plugin.so
7. nsslapd-plugininitfunc: searchdn_preop_init
8. nsslapd-plugintype: preoperation
9. nsslapd-pluginenabled: on
10. nsslapd-pluginid: Example Preoperation Plug-in
11. nsslapd-pluginversion: 1.0
12. nsslapd-pluginvendor: Example Corporation
13. nsslapd-plugindescription: This plug-in does ...
This example plug-in configuration file defines an example plug-in as follows:
Line 1 sets the DN of the plug-in, which identifies the plug-in:
dn: cn=Example Plug-in,cn=plugins,cn=config
Here, the common name of the plug-in is set to Example Plug-in. The remainder of the
DN entry (cn=plugins,cn=config) places the entry in the database tree that contains
the configuration settings for plug-ins.
Lines 2-4 declare the object classes of the plug-in.
Line 5 sets the common name of the plug-in to Example Plug-in.
Line 6 defines the absolute path to the library that implements the plug-in:
nsslapd-pluginpath: /opt/dirsrv/lib/plug-ins/test-plugin.so
Line 7 identifies the initialization function that the server calls to register the plug-in. In this
example, the initialization is set to searchdn_preop_init. For information on
implementing initialization functions, refer to “Writing plug-in initialization functions”.
Line 8 specifies the type of plug-in. In this case, it is a preoperation plug-in. For a complete
list of the types of plug-in you can declare, refer to “Summary of plug-in directives”.
Line 9 specifies whether the plug-in is active by default. The nsslapd-pluginenabled
attribute can have a value of either on or off. The following line specifies that the plug-in
is active by default:
nsslapd-pluginenabled: on
You can also use the Directory Server Console to activate or deactivate the plug-in after it
has been loaded.
3.1 Creating a plug-in configuration file 37