summaryrefslogtreecommitdiffstats
path: root/abs/core/openldap/slapd
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-08-07 17:48:21 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-08-07 17:48:21 (GMT)
commitdf0abbd835cdc168cba9da94c72121f39232ce8a (patch)
tree63e49dd5d0744262da8caa1bd9139202e413902d /abs/core/openldap/slapd
parent9a94627cd98a34f36f7dc200768841a81039afda (diff)
downloadlinhes_pkgbuild-df0abbd835cdc168cba9da94c72121f39232ce8a.zip
linhes_pkgbuild-df0abbd835cdc168cba9da94c72121f39232ce8a.tar.gz
linhes_pkgbuild-df0abbd835cdc168cba9da94c72121f39232ce8a.tar.bz2
openldap 2.4.31
-new
Diffstat (limited to 'abs/core/openldap/slapd')
-rwxr-xr-xabs/core/openldap/slapd49
1 files changed, 49 insertions, 0 deletions
diff --git a/abs/core/openldap/slapd b/abs/core/openldap/slapd
new file mode 100755
index 0000000..4f212da
--- /dev/null
+++ b/abs/core/openldap/slapd
@@ -0,0 +1,49 @@
+#!/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"
+ [ ! -d /run/openldap ] && install -d -m755 -o ldap -g ldap /run/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