mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-08 10:12:59 +01:00
43 lines
1007 B
Plaintext
43 lines
1007 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2012 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: /var/cvsroot/gentoo-x86/net-nds/openldap/files/slapd-initd-2.4.28-r1,v 1.2 2012/02/12 21:35:04 robbat2 Exp $
|
|
|
|
extra_commands="checkconfig"
|
|
pidfile=/var/run/openldap/${SVCNAME}.pid
|
|
|
|
[ -z "$INSTANCE" ] && INSTANCE="openldap${SVCNAME#slapd}"
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
before dbus hald avahi-daemon
|
|
provide ldap
|
|
}
|
|
|
|
start() {
|
|
checkpath --directory --owner ldap:ldap ${pidfile%/*}
|
|
if ! checkconfig -Q ; then
|
|
eerror "There is a problem with your slapd.conf!"
|
|
return 1
|
|
fi
|
|
ebegin "Starting ldap-server"
|
|
[ -n "$KRB5_KTNAME" ] && export KRB5_KTNAME
|
|
eval start-stop-daemon --start \
|
|
--pidfile ${pidfile} \
|
|
--exec /usr/lib/slapd \
|
|
-- \
|
|
-u ldap -g ldap "${OPTS}"
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ldap-server"
|
|
start-stop-daemon --stop --signal 2 --quiet --pidfile ${pidfile}
|
|
eend $?
|
|
}
|
|
|
|
checkconfig() {
|
|
/usr/sbin/slaptest -u "$@" ${OPTS_CONF}
|
|
}
|