19 # information: Portions Copyright [yyyy] [name of copyright owner] |
19 # information: Portions Copyright [yyyy] [name of copyright owner] |
20 # |
20 # |
21 # CDDL HEADER END |
21 # CDDL HEADER END |
22 # |
22 # |
23 |
23 |
24 # Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. |
24 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. |
25 # |
25 # |
26 source /lib/svc/share/smf_include.sh |
26 source /lib/svc/share/smf_include.sh |
27 |
27 |
28 typeset -r LDAPUSR=openldap |
28 typeset -r LDAPUSR=openldap |
29 typeset -r LDAPGRP=openldap |
29 typeset -r LDAPGRP=openldap |
30 typeset -r VARRUNDIR=/var/run/openldap |
30 typeset -r VARRUNDIR=/var/openldap/run |
31 typeset -r PIDFILE=${VARRUNDIR}/slapd.pid |
31 typeset -r PIDFILE=${VARRUNDIR}/slapd.pid |
32 typeset -r CONF_FILE=/etc/openldap/slapd.conf |
32 typeset -r CONF_FILE=/etc/openldap/slapd.conf |
33 typeset -r SLAPD="/usr/lib/slapd -u ${LDAPUSR} -g ${LDAPGRP} -f ${CONF_FILE}" |
33 typeset -r SLAPD="/usr/lib/slapd -u ${LDAPUSR} -g ${LDAPGRP} -f ${CONF_FILE}" |
34 |
34 |
35 [[ ! -f ${CONF_FILE} ]] && exit $SMF_EXIT_ERR_CONFIG |
35 [[ ! -f ${CONF_FILE} ]] && exit $SMF_EXIT_ERR_CONFIG |
36 |
36 |
37 |
37 |
38 case "$1" in |
38 case "$1" in |
39 start) |
39 start) |
40 if [[ ! -d ${VARRUNDIR} ]] ; then |
40 if [[ ! -d ${VARRUNDIR} ]] ; then |
41 /usr/bin/mkdir -m 755 ${VARRUNDIR} || exit $SMF_EXIT_ERR_CONFIG |
41 /usr/bin/mkdir -m 700 ${VARRUNDIR} || exit $SMF_EXIT_ERR_CONFIG |
42 /usr/bin/chown ${LDAPUSR}:${LDAPGRP} ${VARRUNDIR} |
42 /usr/bin/chown ${LDAPUSR}:${LDAPGRP} ${VARRUNDIR} |
43 else |
43 else |
44 /bin/rm -f ${PIDFILE} |
44 /bin/rm -f ${PIDFILE} |
45 fi |
45 fi |
46 |
46 |