2015-04-28 14:34:51 +00:00
|
|
|
#!/sbin/openrc-run
|
2012-03-13 09:21:28 +00:00
|
|
|
|
2017-10-26 20:27:43 +02:00
|
|
|
name="LDAP server"
|
2022-11-06 02:49:15 +01:00
|
|
|
description_checkconfig="Check configuration files for errors"
|
|
|
|
|
2012-03-13 09:21:28 +00:00
|
|
|
extra_commands="checkconfig"
|
2022-11-06 02:49:15 +01:00
|
|
|
|
|
|
|
: ${start_wait=50} # milliseconds
|
2017-10-26 20:27:43 +02:00
|
|
|
|
|
|
|
command="/usr/sbin/slapd"
|
|
|
|
cfg_opt="${cfgdir:+"-F $cfgdir"} ${cfgfile:+"-f $cfgfile"}"
|
2022-11-06 02:49:15 +01:00
|
|
|
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
|
|
|
|
2022-11-06 02:49:15 +01:00
|
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
2017-10-26 20:27:43 +02:00
|
|
|
stopsig=2
|
2022-11-06 02:49:15 +01:00
|
|
|
|
2017-10-26 20:27:43 +02:00
|
|
|
start_stop_daemon_args="
|
2022-11-06 02:49:15 +01:00
|
|
|
${start_wait:+--wait $start_wait}
|
|
|
|
${start_stop_daemon_args-}
|
|
|
|
"
|
|
|
|
# See https://github.com/OpenRC/openrc/pull/558
|
|
|
|
supervise_daemon_args=" $supervise_daemon_args"
|
2009-04-23 12:13:16 +00:00
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
2009-09-15 14:51:48 +00:00
|
|
|
after firewall
|
2012-03-13 09:21:28 +00:00
|
|
|
before dbus hald avahi-daemon
|
|
|
|
provide ldap
|
2009-04-23 12:13:16 +00:00
|
|
|
}
|
|
|
|
|
2017-10-26 20:27:43 +02:00
|
|
|
start_pre() {
|
2022-11-06 02:49:15 +01:00
|
|
|
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
|
2009-04-23 12:13:16 +00:00
|
|
|
}
|
2012-03-13 09:21:28 +00:00
|
|
|
|
|
|
|
checkconfig() {
|
2020-02-23 04:43:37 -03:00
|
|
|
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
|
|
|
}
|