|
|
|
|
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
|
|
|
|
|
##
|
|
|
|
|
## rc.openldap -- Run-Commands
|
|
|
|
|
##
|
|
|
|
|
|
|
|
|
|
%config
|
|
|
|
|
openldap_enable="$openpkg_rc_def"
|
|
|
|
|
openldap_log_prolog="true"
|
|
|
|
|
openldap_log_epilog="true"
|
|
|
|
|
openldap_log_numfiles="10"
|
|
|
|
|
openldap_log_minsize="1M"
|
|
|
|
|
openldap_log_complevel="9"
|
|
|
|
|
|
|
|
|
|
%common
|
|
|
|
|
openldap_pidfile="@l_prefix@/var/openldap/slapd.pid"
|
|
|
|
|
openldap_signal () {
|
|
|
|
|
[ -f $openldap_pidfile ] && kill -$1 `cat $openldap_pidfile`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
%status -u @l_susr@ -o
|
|
|
|
|
openldap_usable="unknown"
|
|
|
|
|
openldap_active="no"
|
|
|
|
|
rcService openldap enable yes && \
|
|
|
|
|
openldap_signal 0 && openldap_active="yes"
|
|
|
|
|
echo "openldap_enable=\"$openldap_enable\""
|
|
|
|
|
echo "openldap_usable=\"$openldap_usable\""
|
|
|
|
|
echo "openldap_active=\"$openldap_active\""
|
|
|
|
|
|
|
|
|
|
%start -u @l_susr@
|
|
|
|
|
rcService openldap enable yes || exit 0
|
|
|
|
|
@l_prefix@/libexec/openldap/slapd
|
|
|
|
|
|
|
|
|
|
%stop -u @l_susr@
|
|
|
|
|
rcService openldap enable yes || exit 0
|
|
|
|
|
openldap_signal INT
|
|
|
|
|
|
|
|
|
|
%restart -u @l_susr@
|
|
|
|
|
rcService openldap enable yes || exit 0
|
|
|
|
|
openldap_signal INT
|
|
|
|
|
sleep 2
|
|
|
|
|
@l_prefix@/libexec/openldap/slapd
|
|
|
|
|
|
|
|
|
|
%daily -u @l_susr@
|
|
|
|
|
rcService openldap enable yes || exit 0
|
|
|
|
|
|
|
|
|
|
# rotate logfile
|
|
|
|
|
shtool rotate -f \
|
|
|
|
|
-n ${openldap_log_numfiles} -s ${openldap_log_minsize} -d \
|
|
|
|
|
-z ${openldap_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
|
|
|
|
|
-P "${openldap_log_prolog}" \
|
|
|
|
|
-E "${openldap_log_epilog}" \
|
|
|
|
|
@l_prefix@/var/openldap/openldap.log
|
|
|
|
|
|