Patchwork [2/3] contrib: Add tools to help configure LDAP servers as NSDBs

login
register
mail settings
Submitter Chuck Lever
Date Dec. 6, 2012, 5:02 p.m.
Message ID <20121206170206.5988.75687.stgit@seurat.1015granger.net>
Download mbox | patch
Permalink /patch/204288/
State Accepted
Headers show

Comments

Chuck Lever - Dec. 6, 2012, 5:02 p.m.
Setting up an NSDB takes a bunch of detailed steps.  To encourage
adoption of FedFS (or at least broaden our base of testers), we want
to make NSDB set up easier to do.  One of the challenges is that
each LDAP server implementation requires different administrative
tools and procedures.

Thus, for each LDAP server implementation, we can add tools that
set up the FedFS schema, create root suffixes, and so on.  Of course
some server implementations will not succumb to this approach, as
they will still require manual set up on the servers themselves.  We
can but try.

As a first step, create a landing place for server-specific tools
and introduce a few sample tools to remotely configure LDAP servers.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 configure.ac                  |    1 
 contrib/Makefile.am           |    2 
 contrib/ldap/Makefile.am      |   31 ++++
 contrib/ldap/add-database-olc |   64 ++++++++
 contrib/ldap/add-fedfs-entry  |   50 ++++++
 contrib/ldap/add-referral-olc |   55 +++++++
 contrib/ldap/add-schema-389   |  346 +++++++++++++++++++++++++++++++++++++++++
 contrib/ldap/add-schema-olc   |  287 ++++++++++++++++++++++++++++++++++
 8 files changed, 835 insertions(+), 1 deletions(-)
 create mode 100644 contrib/ldap/Makefile.am
 create mode 100755 contrib/ldap/add-database-olc
 create mode 100755 contrib/ldap/add-fedfs-entry
 create mode 100755 contrib/ldap/add-referral-olc
 create mode 100755 contrib/ldap/add-schema-389
 create mode 100755 contrib/ldap/add-schema-olc

Patch

diff --git a/configure.ac b/configure.ac
index 31634cb..2ae2031 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,6 +160,7 @@  AC_SUBST([root_sbindir])
 AC_CONFIG_FILES([Makefile
                  contrib/Makefile
                  contrib/init/Makefile
+                 contrib/ldap/Makefile
                  doc/Makefile
                  doc/ldap/Makefile
                  doc/man/Makefile
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index ee19f6b..190f5d0 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -23,7 +23,7 @@ 
 ##	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
 ##
 
-SUBDIRS			= init
+SUBDIRS			= init ldap
 
 CLEANFILES		= cscope.in.out cscope.out cscope.po.out *~
 DISTCLEANFILES		= Makefile.in
diff --git a/contrib/ldap/Makefile.am b/contrib/ldap/Makefile.am
new file mode 100644
index 0000000..a4fa290
--- /dev/null
+++ b/contrib/ldap/Makefile.am
@@ -0,0 +1,31 @@ 
+##
+## @file contrib/ldap/Makefile.am
+## @brief Process this file with automake to produce contrib/ldap/Makefile.in
+##
+
+##
+## Copyright 2012 Oracle.  All rights reserved.
+##
+## This file is part of fedfs-utils.
+##
+## fedfs-utils is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License version 2.0 as
+## published by the Free Software Foundation.
+##
+## fedfs-utils is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License version 2.0 for more details.
+##
+## You should have received a copy of the GNU General Public License
+## version 2.0 along with fedfs-utils.  If not, see:
+##
+##	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+##
+
+EXTRA_DIST		= add-schema-olc add-database-olc add-referral-olc \
+			  add-schema-389 \
+			  add-fedfs-entry
+
+CLEANFILES		= cscope.in.out cscope.out cscope.po.out *~
+DISTCLEANFILES		= Makefile.in
diff --git a/contrib/ldap/add-database-olc b/contrib/ldap/add-database-olc
new file mode 100755
index 0000000..362b8f4
--- /dev/null
+++ b/contrib/ldap/add-database-olc
@@ -0,0 +1,64 @@ 
+#!/bin/bash
+#
+# @file contrib/ldap/add-database-olc
+# @brief Add a database backend to an LDAP server via OLConfig
+#
+# Copyright 2012 Oracle.  All rights reserved.
+#
+# This file is part of fedfs-utils.
+#
+# fedfs-utils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2.0 as
+# published by the Free Software Foundation.
+#
+# fedfs-utils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License version 2.0 for more details.
+#
+# You should have received a copy of the GNU General Public License
+# version 2.0 along with fedfs-utils.  If not, see:
+#
+#	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+#
+
+#
+# This script may require some change before it is invoked to
+# create a database backend.
+#
+#   o The value of the olcDbDirectory attribute should reflect
+#     the file system location of the database on the LDAP server.
+#
+#   o The value of the olcRootDN and olcRootPW attributes may be
+#     updated depending on local policy (see slappasswd(5)).
+#
+
+
+LDAPMODIFY=`which ldapmodify`
+if [[ $? != 0 ]];
+then
+  echo "ldapmodify command not found on this system"
+  exit 1
+fi
+
+if [[ $# -lt 2 ]];
+then
+  echo "Usage: add-database-olc <LDAP server's hostname> <LDAP server's admin DN>"
+  echo " "
+  echo "  Add the FedFS schema via the OLConfig administrative interface."
+  echo " "
+  exit 1
+fi
+
+${LDAPMODIFY} -a -x -W -h $1 -D "$2" <<EOF
+dn: olcDatabase=bdb,cn=config
+objectClass: olcBdbConfig
+olcDatabase: bdb
+olcDbDirectory: /var/lib/ldap/fedfs
+olcSuffix: o=fedfs
+olcRootDN: cn=admin,o=fedfs
+olcRootPW: ChangeMe
+olcDbIndex: objectClass pres,eq
+olcDbIndex: fedFsFsnUuid pres,eq
+olcDbIndex: fedFsFslUuid pres,eq
+EOF
diff --git a/contrib/ldap/add-fedfs-entry b/contrib/ldap/add-fedfs-entry
new file mode 100755
index 0000000..a2418ba
--- /dev/null
+++ b/contrib/ldap/add-fedfs-entry
@@ -0,0 +1,50 @@ 
+#!/bin/bash
+#
+# @file contrib/ldap/add-fedfs-entry
+# @brief Add an "o=fedfs" entry
+#
+# Copyright 2012 Oracle.  All rights reserved.
+#
+# This file is part of fedfs-utils.
+#
+# fedfs-utils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2.0 as
+# published by the Free Software Foundation.
+#
+# fedfs-utils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License version 2.0 for more details.
+#
+# You should have received a copy of the GNU General Public License
+# version 2.0 along with fedfs-utils.  If not, see:
+#
+#	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+#
+
+LDAPMODIFY=`which ldapmodify`
+if [[ $? != 0 ]];
+then
+  echo "ldapmodify command not found on this system"
+  exit 1
+fi
+
+if [[ $# -lt 2 ]];
+then
+  echo "Usage: add-fedfs-entry <LDAP server's hostname> <LDAP server's admin DN>"
+  echo " "
+  echo "  Add an 'o=fedfs' entry to an LDAP server."
+  echo " "
+  exit 1
+fi
+
+#
+# Note: a database has to be defined on the LDAP server for the
+#       "o=fedfs" root suffix before this modify operation will work.
+#
+
+${LDAPMODIFY} -a -x -W -h $1 -D "$2" <<EOF
+dn: o=fedfs
+objectClass: organization
+o: fedfs
+EOF
diff --git a/contrib/ldap/add-referral-olc b/contrib/ldap/add-referral-olc
new file mode 100755
index 0000000..ba5f5a1
--- /dev/null
+++ b/contrib/ldap/add-referral-olc
@@ -0,0 +1,55 @@ 
+#!/bin/bash
+#
+# @file contrib/ldap/add-referral-olc
+# @brief Add a referral directive to an LDAP server via OLConfig
+#
+# Copyright 2012 Oracle.  All rights reserved.
+#
+# This file is part of fedfs-utils.
+#
+# fedfs-utils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2.0 as
+# published by the Free Software Foundation.
+#
+# fedfs-utils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License version 2.0 for more details.
+#
+# You should have received a copy of the GNU General Public License
+# version 2.0 along with fedfs-utils.  If not, see:
+#
+#	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+#
+
+#
+# This script may require some change before it is invoked to
+# introduce a global referral directive
+#
+#   o The value of the olcReferral attribute should reflect
+#     the URI of the referred-to LDAP server
+#
+
+
+LDAPMODIFY=`which ldapmodify`
+if [[ $? != 0 ]];
+then
+  echo "ldapmodify command not found on this system"
+  exit 1
+fi
+
+if [[ $# -lt 2 ]];
+then
+  echo "Usage: add-referral-olc <LDAP server's hostname> <LDAP server's admin DN>"
+  echo " "
+  echo "  Add a referral directive via the OLConfig administrative interface."
+  echo " "
+  exit 1
+fi
+
+${LDAPMODIFY} -x -W -h $1 -D "$2" <<EOF
+dn: cn=config
+changetype: modify
+add: olcReferral
+olcReferral: ldap://ldap.example.net
+EOF
diff --git a/contrib/ldap/add-schema-389 b/contrib/ldap/add-schema-389
new file mode 100755
index 0000000..971c83e
--- /dev/null
+++ b/contrib/ldap/add-schema-389
@@ -0,0 +1,346 @@ 
+#!/bin/bash
+#
+# @file contrib/ldap/add-schema-389
+# @brief Add the FedFS schema to a 389-ds LDAP server via ldapmodify
+#
+# Copyright 2012 Oracle.  All rights reserved.
+#
+# This file is part of fedfs-utils.
+#
+# fedfs-utils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2.0 as
+# published by the Free Software Foundation.
+#
+# fedfs-utils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License version 2.0 for more details.
+#
+# You should have received a copy of the GNU General Public License
+# version 2.0 along with fedfs-utils.  If not, see:
+#
+#	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+#
+
+#
+# Updating this script should be necessary only when the FedFS
+# schema changes.  The FedFS schema LDIF below is formed by
+# copying and editing doc/ldap/fedfs-schema.ldif
+#
+#   1.  after the "dn" line add "changetype: modify"
+#   2.  move the objectClasses definitions after the attributeTypes definitions
+#   3.  before each "attributeTypes:" line, add "add: attributeTypes"
+#   4.  before each "objectClasses:" line, add "add: objectClasses"
+#   5.  after each " )" line except the last, add "-"
+#   6.  replace the EQUALITY, ORDERING, and SYNTAX lines in the fedfsUuid
+#       attribute type with " SUP nsUniqueID "
+#   7.  move the fedfsUuid record just before the objectClass definitions
+#   8.  remove any lines that begin with "#"
+#
+# Then replace the "here" document in this script with the result.
+#
+
+LDAPMODIFY=`which ldapmodify`
+if [[ $? != 0 ]];
+then
+  echo "ldapmodify command not found on this system"
+  exit 1
+fi
+
+if [[ $# -lt 2 ]];
+then
+  echo "Usage: add-fedfs-schema <LDAP server's hostname> <LDAP server's admin DN>"
+  echo " "
+  echo "  Add the FedFS schema to a 389-ds LDAP server via ldapmodify."
+  echo " "
+  exit 1
+fi
+
+${LDAPMODIFY} -x -W -h $1 -D "$2" <<EOF
+dn: cn=schema
+changetype: modify
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.4 
+ NAME 'fedfsFsnUuid' 
+ DESC 'The FSN UUID component of an FSN' 
+ SUP fedfsUuid 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.11 
+ NAME 'fedfsFsnTTL' 
+ DESC 'Time to live of an FSN tree' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.14 
+ NAME 'fedfsNceDN' 
+ DESC 'NCE Distinguished Name' 
+ EQUALITY distinguishedNameMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.8 
+ NAME 'fedfsFslUuid' 
+ DESC 'UUID of an FSL' 
+ SUP fedfsUuid 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.12 
+ NAME 'fedfsAnnotation' 
+ DESC 'Annotation of an object' 
+ SUP name 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.13 
+ NAME 'fedfsDescr' 
+ DESC 'Description of an object' 
+ SUP name 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.120 
+ NAME 'fedfsNfsURI' 
+ DESC 'Location of fileset' 
+ SUP labeledURI 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.103 
+ NAME 'fedfsNfsCurrency' 
+ DESC 'up-to-date measure of the data' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.104 
+ NAME 'fedfsNfsGenFlagWritable' 
+ DESC 'Indicates if the filesystem is writable' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.105 
+ NAME 'fedfsNfsGenFlagGoing' 
+ DESC 'Indicates if the filesystem is going' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.106 
+ NAME 'fedfsNfsGenFlagSplit' 
+ DESC 'Indicates if there are multiple filesystems' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.107 
+ NAME 'fedfsNfsTransFlagRdma' 
+ DESC 'Indicates if the transport supports RDMA' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.108 
+ NAME 'fedfsNfsClassSimul' 
+ DESC 'The simultaneous-use class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.109 
+ NAME 'fedfsNfsClassHandle' 
+ DESC 'The handle class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.110 
+ NAME 'fedfsNfsClassFileid' 
+ DESC 'The fileid class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.111 
+ NAME 'fedfsNfsClassWritever' 
+ DESC 'The write-verifier class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.112 
+ NAME 'fedfsNfsClassChange' 
+ DESC 'The change class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.113 
+ NAME 'fedfsNfsClassReaddir' 
+ DESC 'The readdir class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.114 
+ NAME 'fedfsNfsReadRank' 
+ DESC 'The read rank of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.115 
+ NAME 'fedfsNfsReadOrder' 
+ DESC 'The read order of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.116 
+ NAME 'fedfsNfsWriteRank' 
+ DESC 'The write rank of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.117 
+ NAME 'fedfsNfsWriteOrder' 
+ DESC 'The write order of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.118 
+ NAME 'fedfsNfsVarSub' 
+ DESC 'Indicates if variable substitution is present' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.19 
+ NAME 'fedfsNfsValidFor' 
+ DESC 'Valid for time' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+-
+add: attributeTypes
+attributeTypes: (
+ 1.3.6.1.4.1.31103.1.1 
+ NAME 'fedfsUuid' 
+ DESC 'A UUID used by NSDB' 
+ SUP nsUniqueID 
+ SINGLE-VALUE 
+ )
+-
+add: objectClasses
+objectClasses: (
+ 1.3.6.1.4.1.31103.1.1001 
+ NAME 'fedfsNsdbContainerInfo' 
+ DESC 'Describes NCE location' 
+ SUP top 
+ AUXILIARY 
+ MUST ( fedfsNceDN ) 
+ MAY ( fedfsAnnotation $ fedfsDescr ) 
+ )
+-
+add: objectClasses
+objectClasses: (
+ 1.3.6.1.4.1.31103.1.1002 
+ NAME 'fedfsFsn' 
+ DESC 'Represents a fileset' 
+ SUP top 
+ STRUCTURAL 
+ MUST ( fedfsFsnUuid $ fedfsFsnTTL ) 
+ MAY ( fedfsAnnotation $ fedfsDescr ) 
+ )
+-
+add: objectClasses
+objectClasses: (
+ 1.3.6.1.4.1.31103.1.1003 
+ NAME 'fedfsFsl' 
+ DESC 'A physical location of a fileset' 
+ SUP top 
+ ABSTRACT 
+ MUST ( fedfsFslUuid $ fedfsFsnUuid ) 
+ MAY ( fedfsAnnotation $ fedfsDescr ) 
+ )
+-
+add: objectClasses
+objectClasses: (
+ 1.3.6.1.4.1.31103.1.1004 
+ NAME 'fedfsNfsFsl' 
+ DESC 'An NFS location of a fileset' 
+ SUP fedfsFsl 
+ STRUCTURAL 
+ MUST ( fedfsNfsURI $ fedfsNfsCurrency $ fedfsNfsGenFlagWritable $ fedfsNfsGenFlagGoing $ fedfsNfsGenFlagSplit $ fedfsNfsTransFlagRdma $ fedfsNfsClassSimul $ fedfsNfsClassHandle $ fedfsNfsClassFileid $ fedfsNfsClassWritever $ fedfsNfsClassChange $ fedfsNfsClassReaddir $ fedfsNfsReadRank $ fedfsNfsReadOrder $ fedfsNfsWriteRank $ fedfsNfsWriteOrder $ fedfsNfsVarSub $ fedfsNfsValidFor ) 
+ )
+EOF
diff --git a/contrib/ldap/add-schema-olc b/contrib/ldap/add-schema-olc
new file mode 100755
index 0000000..768e6b3
--- /dev/null
+++ b/contrib/ldap/add-schema-olc
@@ -0,0 +1,287 @@ 
+#!/bin/bash
+#
+# @file contrib/ldap/add-schema-olc
+# @brief Add the FedFS schema to an LDAP server via OLConfig
+#
+# Copyright 2012 Oracle.  All rights reserved.
+#
+# This file is part of fedfs-utils.
+#
+# fedfs-utils is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2.0 as
+# published by the Free Software Foundation.
+#
+# fedfs-utils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License version 2.0 for more details.
+#
+# You should have received a copy of the GNU General Public License
+# version 2.0 along with fedfs-utils.  If not, see:
+#
+#	http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
+#
+
+#
+# Updating this script should be necessary only when the FedFS
+# schema changes.  The FedFS schema LDIF below is formed by
+# copying and editing doc/ldap/fedfs-schema.ldif
+#
+#   1.  add the "dn", "objectClass", and "cn" lines below
+#   2.  :%s/attributeTypes:/olcAttributeTypes:/g
+#   3.  :%s/objectClasses:/olcObjectClasses:/g
+#   4.  optionally remove any lines that begin with "#"
+#
+# Then replace the "here" document in this script with the result.
+#
+
+LDAPMODIFY=`which ldapmodify`
+if [[ $? != 0 ]];
+then
+  echo "ldapmodify command not found on this system"
+  exit 1
+fi
+
+if [[ $# -lt 2 ]];
+then
+  echo "Usage: add-schema-olc <LDAP server's hostname> <LDAP server's admin DN>"
+  echo " "
+  echo "  Add the FedFS schema via the OLConfig administrative interface."
+  echo " "
+  exit 1
+fi
+
+${LDAPMODIFY} -a -x -W -h $1 -D "$2" <<EOF
+dn: cn=fedfs,cn=schema,cn=config
+objectClass: olcSchemaConfig
+cn: fedfs
+olcObjectClasses: (
+ 1.3.6.1.4.1.31103.1.1001 
+ NAME 'fedfsNsdbContainerInfo' 
+ DESC 'Describes NCE location' 
+ SUP top 
+ AUXILIARY 
+ MUST ( fedfsNceDN ) 
+ MAY ( fedfsAnnotation $ fedfsDescr ) 
+ )
+olcObjectClasses: (
+ 1.3.6.1.4.1.31103.1.1002 
+ NAME 'fedfsFsn' 
+ DESC 'Represents a fileset' 
+ SUP top 
+ STRUCTURAL 
+ MUST ( fedfsFsnUuid $ fedfsFsnTTL ) 
+ MAY ( fedfsAnnotation $ fedfsDescr ) 
+ )
+olcObjectClasses: (
+ 1.3.6.1.4.1.31103.1.1003 
+ NAME 'fedfsFsl' 
+ DESC 'A physical location of a fileset' 
+ SUP top 
+ ABSTRACT 
+ MUST ( fedfsFslUuid $ fedfsFsnUuid ) 
+ MAY ( fedfsAnnotation $ fedfsDescr ) 
+ )
+olcObjectClasses: (
+ 1.3.6.1.4.1.31103.1.1004 
+ NAME 'fedfsNfsFsl' 
+ DESC 'An NFS location of a fileset' 
+ SUP fedfsFsl 
+ STRUCTURAL 
+ MUST ( fedfsNfsURI $ fedfsNfsCurrency $ fedfsNfsGenFlagWritable $ fedfsNfsGenFlagGoing $ fedfsNfsGenFlagSplit $ fedfsNfsTransFlagRdma $ fedfsNfsClassSimul $ fedfsNfsClassHandle $ fedfsNfsClassFileid $ fedfsNfsClassWritever $ fedfsNfsClassChange $ fedfsNfsClassReaddir $ fedfsNfsReadRank $ fedfsNfsReadOrder $ fedfsNfsWriteRank $ fedfsNfsWriteOrder $ fedfsNfsVarSub $ fedfsNfsValidFor ) 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.1 
+ NAME 'fedfsUuid' 
+ DESC 'A UUID used by NSDB' 
+ EQUALITY uuidMatch 
+ ORDERING uuidOrderingMatch 
+ SYNTAX 1.3.6.1.1.16.1 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.4 
+ NAME 'fedfsFsnUuid' 
+ DESC 'The FSN UUID component of an FSN' 
+ SUP fedfsUuid 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.11 
+ NAME 'fedfsFsnTTL' 
+ DESC 'Time to live of an FSN tree' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.14 
+ NAME 'fedfsNceDN' 
+ DESC 'NCE Distinguished Name' 
+ EQUALITY distinguishedNameMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.8 
+ NAME 'fedfsFslUuid' 
+ DESC 'UUID of an FSL' 
+ SUP fedfsUuid 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.12 
+ NAME 'fedfsAnnotation' 
+ DESC 'Annotation of an object' 
+ SUP name 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.13 
+ NAME 'fedfsDescr' 
+ DESC 'Description of an object' 
+ SUP name 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.120 
+ NAME 'fedfsNfsURI' 
+ DESC 'Location of fileset' 
+ SUP labeledURI 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.103 
+ NAME 'fedfsNfsCurrency' 
+ DESC 'up-to-date measure of the data' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.104 
+ NAME 'fedfsNfsGenFlagWritable' 
+ DESC 'Indicates if the filesystem is writable' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.105 
+ NAME 'fedfsNfsGenFlagGoing' 
+ DESC 'Indicates if the filesystem is going' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.106 
+ NAME 'fedfsNfsGenFlagSplit' 
+ DESC 'Indicates if there are multiple filesystems' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.107 
+ NAME 'fedfsNfsTransFlagRdma' 
+ DESC 'Indicates if the transport supports RDMA' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.108 
+ NAME 'fedfsNfsClassSimul' 
+ DESC 'The simultaneous-use class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.109 
+ NAME 'fedfsNfsClassHandle' 
+ DESC 'The handle class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.110 
+ NAME 'fedfsNfsClassFileid' 
+ DESC 'The fileid class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.111 
+ NAME 'fedfsNfsClassWritever' 
+ DESC 'The write-verifier class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.112 
+ NAME 'fedfsNfsClassChange' 
+ DESC 'The change class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.113 
+ NAME 'fedfsNfsClassReaddir' 
+ DESC 'The readdir class of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.114 
+ NAME 'fedfsNfsReadRank' 
+ DESC 'The read rank of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.115 
+ NAME 'fedfsNfsReadOrder' 
+ DESC 'The read order of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.116 
+ NAME 'fedfsNfsWriteRank' 
+ DESC 'The write rank of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.117 
+ NAME 'fedfsNfsWriteOrder' 
+ DESC 'The write order of the filesystem' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.118 
+ NAME 'fedfsNfsVarSub' 
+ DESC 'Indicates if variable substitution is present' 
+ EQUALITY booleanMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
+ SINGLE-VALUE 
+ )
+olcAttributeTypes: (
+ 1.3.6.1.4.1.31103.1.19 
+ NAME 'fedfsNfsValidFor' 
+ DESC 'Valid for time' 
+ EQUALITY integerMatch 
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
+ SINGLE-VALUE 
+ )
+EOF