#!/sbin/openrc-run # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id: 0bb8c81cbcdadbded71a22b877d3f915be2c05cb $ extra_commands="checkconfig" [ -z "$INSTANCE" ] && INSTANCE="openldap${SVCNAME#slapd}" depend() { need net before dbus hald avahi-daemon provide ldap } start() { checkpath -q -d /var/run/openldap/ -o ldap:ldap if ! checkconfig -Q ; then eerror "There is a problem with your slapd.conf!" return 1 fi ebegin "Starting ldap-server" [ -n "$KRB5_KTNAME" ] && export KRB5_KTNAME eval start-stop-daemon --start --pidfile /var/run/openldap/${SVCNAME}.pid --exec /usr/lib/openldap/slapd -- -u ldap -g ldap "${OPTS}" eend $? } stop() { ebegin "Stopping ldap-server" start-stop-daemon --stop --signal 2 --quiet --pidfile /var/run/openldap/${SVCNAME}.pid eend $? } checkconfig() { /usr/sbin/slaptest -u "$@" ${OPTS_CONF} }