#!/bin/sh # # ldap This shell script takes care of starting and stopping # ldap servers (slapd and slurpd). # # chkconfig: - 70 40 # description: LDAP stands for Lightweight Directory Access Protocol, used \ # for implementing the industry standard directory services. # processname: slapd # config: /usr/local/etc/openldap/slapd.conf # pidfile: /var/run/slapd.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -f /usr/local/libexec/slapd ] || exit 0 [ -f /usr/local/libexec/slurpd ] || exit 0 RETVAL=0 # See how we were called. case "$1" in start) # Start daemons. echo -n "Starting ldap: " daemon /usr/local/libexec/slapd -f /usr/local/etc/openldap/slapd.conf RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldap echo ;; stop) # Stop daemons. echo -n "Shutting down ldap: " killproc /usr/local/libexec/slapd RETVAL=$? echo if [ $RETVAL -eq 0 ]; then rm -f /var/lock/subsys/ldap rm -f /var/run/slapd.args fi ;; status) status slapd RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; reload) killproc -HUP /usr/local/libexec/slapd RETVAL=$? ;; *) echo "Usage: $0 start|stop|restart|status}" exit 1 esac exit $RETVAL