summaryrefslogtreecommitdiff
path: root/nonsystemd/openldap-openrc/slapd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'nonsystemd/openldap-openrc/slapd.initd')
-rw-r--r--nonsystemd/openldap-openrc/slapd.initd29
1 files changed, 29 insertions, 0 deletions
diff --git a/nonsystemd/openldap-openrc/slapd.initd b/nonsystemd/openldap-openrc/slapd.initd
new file mode 100644
index 000000000..6c605df7a
--- /dev/null
+++ b/nonsystemd/openldap-openrc/slapd.initd
@@ -0,0 +1,29 @@
+#!/usr/bin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net.lo
+ before hald avahi-daemon
+}
+
+start() {
+ checkpath -q -d /run/openldap/ -o ldap:ldap
+ if ! checkconfig ; then
+ eerror "There is a problem with your slapd.conf!"
+ return 1
+ fi
+ ebegin "Starting ldap-server"
+ eval start-stop-daemon --start --pidfile /run/openldap/slapd.pid --exec /usr/lib/slapd -- -u ldap -g ldap "${OPTS}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ldap-server"
+ start-stop-daemon --stop --signal 2 --quiet --pidfile /run/openldap/slapd.pid
+ eend $?
+}
+
+checkconfig() {
+ /usr/bin/slaptest -u "$@" ${OPTS_CONF}
+}