Adding additional schemas to slapd requires the schema to be converted to LDIF format. Fortunately, the slapd program can be used to automate the conversion. The following example will add the misc.schema:
1. First, create a conversion schema_convert.conf file containing the following lines:
include /etc/ldap/schema/core.schema include /etc/ldap/schema/collective.schema include /etc/ldap/schema/corba.schema include /etc/ldap/schema/cosine.schema include /etc/ldap/schema/duaconf.schema include /etc/ldap/schema/dyngroup.schema include /etc/ldap/schema/inetorgperson.schema include /etc/ldap/schema/java.schema include /etc/ldap/schema/misc.schema include /etc/ldap/schema/nis.schema include /etc/ldap/schema/openldap.schema include /etc/ldap/schema/ppolicy.schema
2. Next, create a temporary directory to hold the output:
mkdir /tmp/ldif_output
3. Now using slaptest convert the schema files to LDIF:
slaptest -f schema_convert.conf -F /tmp/ldif_output
Adjust the configuration file name and temporary directory names if yours are different. Also, it may be worthwhile to keep the ldif_output directory around in case you want to add additional schemas in the future.
4. Edit the /tmp/ldif_output/cn=config/cn=schema/cn={8}misc.ldif file, changing the following attributes:
dn: cn=misc,cn=schema,cn=config … cn: misc
And remove the following lines from the bottom of the file:
structuralObjectClass: olcSchemaConfig entryUUID: 10dae0ea-0760-102d-80d3-f9366b7f7757 creatorsName: cn=config createTimestamp: 20080826021140Z entryCSN: 20080826021140.791425Z#000000#000#000000 modifiersName: cn=config modifyTimestamp: 20080826021140Z
[Note]
The attribute values will vary, just be sure the attributes are removed.
5. Finally, using the ldapadd utility, add the new schema to the directory:
ldapadd -x -D cn=admin,cn=config -f /tmp/ldif_output/cn\=config/cn\=schema/cn\=\{8\}misc.ldif
There should now be a dn: cn={4}misc,cn=schema,cn=config entry in the cn=config tree.
RFC2307AIX; The RFC2307AIX schema includes the RFC2307 schema plus the AIX specific object classes, aixAuxAccount and aixAuxGroup. The AIX specific object classes provide attributes to store additional attributes not defined by the RFC2307 standard.
List all active schema loaded into the LDAP
root@rhel:~# ldapsearch -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config cn | grep ^dn