summaryrefslogtreecommitdiff
path: root/core/openldap/slapd
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-07-24 00:03:37 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-07-24 00:03:37 -0500
commit070c331922151d301e3147728cae638902b61db9 (patch)
tree72e112fe8edc90e296f318b0603f3288369f43a9 /core/openldap/slapd
parent0d18015803bebeb58911bf791653597291056095 (diff)
parent0e8166d926f929f470d01d5bc8c8823e094742da (diff)
Commiting libre package llvm-2.9-6
Diffstat (limited to 'core/openldap/slapd')
-rwxr-xr-xcore/openldap/slapd48
1 files changed, 48 insertions, 0 deletions
diff --git a/core/openldap/slapd b/core/openldap/slapd
new file mode 100755
index 000000000..5156b4d61
--- /dev/null
+++ b/core/openldap/slapd
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f "/etc/conf.d/slapd" ] && . /etc/conf.d/slapd
+
+PID=`pidof -o %PPID /usr/sbin/slapd`
+case "$1" in
+ start)
+ stat_busy "Starting OpenLDAP"
+ if [ -z "$PID" ]; then
+ if [ -z "$SLAPD_SERVICES" ]; then
+ /usr/sbin/slapd -u ldap -g ldap $SLAPD_OPTIONS
+ else
+ /usr/sbin/slapd -u ldap -g ldap -h "$SLAPD_SERVICES" $SLAPD_OPTIONS
+ fi
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ stat_done
+ fi
+ add_daemon slapd
+ else
+ stat_fail
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping OpenLDAP"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm -f /run/openldap/slapd.pid
+ rm -f /run/openldap/slapd.args
+ rm_daemon slapd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0