summaryrefslogtreecommitdiff
path: root/testing/openldap/slapd
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-03-19 00:01:09 +0000
committerroot <root@rshg054.dnsready.net>2012-03-19 00:01:09 +0000
commitde5b6982e42f4a1e8b0537cfbc1b676e2a81f195 (patch)
tree54a8758af5dc5a08f95d12f7fe04cec1d51024a6 /testing/openldap/slapd
parentd14a25fc4f65ae3d6e62f4668e9cb88d74834255 (diff)
Mon Mar 19 00:01:09 UTC 2012
Diffstat (limited to 'testing/openldap/slapd')
-rwxr-xr-xtesting/openldap/slapd49
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/openldap/slapd b/testing/openldap/slapd
new file mode 100755
index 000000000..4f212da66
--- /dev/null
+++ b/testing/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