--- a/components/openldap/Solaris/ldap-olslapd Mon Aug 05 23:01:17 2013 -0700
+++ b/components/openldap/Solaris/ldap-olslapd Tue Aug 06 14:25:22 2013 -0700
@@ -21,13 +21,14 @@
# CDDL HEADER END
#
-# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
#
source /lib/svc/share/smf_include.sh
typeset -r LDAPUSR=openldap
typeset -r LDAPGRP=openldap
-typeset -r VARRUNDIR=/var/run/openldap
+typeset -r VARRUNDIR=/var/openldap/run
+typeset -r VARDATADIR=/var/openldap/openldap-data
typeset -r PIDFILE=${VARRUNDIR}/slapd.pid
typeset -r CONF_FILE=/etc/openldap/slapd.conf
typeset -r SLAPD="/usr/lib/slapd -u ${LDAPUSR} -g ${LDAPGRP} -f ${CONF_FILE}"
@@ -38,12 +39,14 @@
case "$1" in
start)
if [[ ! -d ${VARRUNDIR} ]] ; then
- /usr/bin/mkdir -m 755 ${VARRUNDIR} || exit $SMF_EXIT_ERR_CONFIG
+ /usr/bin/mkdir -m 700 ${VARRUNDIR} || exit $SMF_EXIT_ERR_CONFIG
/usr/bin/chown ${LDAPUSR}:${LDAPGRP} ${VARRUNDIR}
else
/bin/rm -f ${PIDFILE}
fi
+ cd ${VARDATADIR}
+ /usr/bin/db_recover >/dev/null 2>&1
exec ${SLAPD} 2>&1
;;
stop)