aports/main/openldap/slapd.initd

54 lines
1 KiB
Bash
Raw Normal View History

#!/sbin/openrc-run
2012-03-13 09:21:28 +00:00
2017-10-26 20:27:43 +02:00
name="LDAP server"
description_checkconfig="Check configuration files for errors"
2012-03-13 09:21:28 +00:00
extra_commands="checkconfig"
: ${start_wait=50} # milliseconds
2017-10-26 20:27:43 +02:00
command="/usr/sbin/slapd"
cfg_opt="${cfgdir:+"-F $cfgdir"} ${cfgfile:+"-f $cfgfile"}"
command_args="
-u ldap -g ldap
-l DAEMON
${listen_uris:+-h \"$listen_uris\"}
-d0
$cfg_opt
${command_args-}
"
command_background=yes
2012-03-13 09:21:28 +00:00
pidfile="/run/$RC_SVCNAME.pid"
2017-10-26 20:27:43 +02:00
stopsig=2
2017-10-26 20:27:43 +02:00
start_stop_daemon_args="
${start_wait:+--wait $start_wait}
${start_stop_daemon_args-}
"
# See https://github.com/OpenRC/openrc/pull/558
supervise_daemon_args=" $supervise_daemon_args"
depend() {
need net
after firewall
2012-03-13 09:21:28 +00:00
before dbus hald avahi-daemon
provide ldap
}
2017-10-26 20:27:43 +02:00
start_pre() {
export KRB5_KTNAME
# NOTE: This directory is not used by default, it's created mainly for
# backward compatibility.
checkpath -d -o ldap:ldap /run/openldap || return 1
2017-10-26 20:27:43 +02:00
/usr/sbin/slaptest -u -Q $cfg_opt || /usr/sbin/slaptest -u $cfg_opt
}
2012-03-13 09:21:28 +00:00
checkconfig() {
ebegin "Checking $name configuration"
2017-10-26 20:27:43 +02:00
/usr/sbin/slaptest -u $cfg_opt
eend $?
2012-03-13 09:21:28 +00:00
}