summaryrefslogtreecommitdiff
path: root/staging/openldap/slapd
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-06-20 23:03:55 +0000
committerroot <root@rshg047.dnsready.net>2011-06-20 23:03:55 +0000
commitf02c28de0bbcb85e152fc19d0008805021fe1a33 (patch)
tree0cb0a135fbbb06d2e31fe64ff2caad474dcc3813 /staging/openldap/slapd
parent5457eacc747fc3f91e10a1f452230b1feac39eff (diff)
Mon Jun 20 23:03:54 UTC 2011
Diffstat (limited to 'staging/openldap/slapd')
-rwxr-xr-xstaging/openldap/slapd48
1 files changed, 48 insertions, 0 deletions
diff --git a/staging/openldap/slapd b/staging/openldap/slapd
new file mode 100755
index 000000000..392075027
--- /dev/null
+++ b/staging/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 $SLAPD_OPTIONS
+ else
+ /usr/sbin/slapd -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 /var/run/slapd.pid
+ rm -f /var/run/slapd.args
+ rm_daemon slapd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0