You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
## rc.openldap -- Run-Commands
##
%config
openldap_enable="$openpkg_rc_def"
23 years ago
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
rcService openldap active yes && exit 0
@l_prefix@/libexec/openldap/slapd
%stop -u @l_susr@
rcService openldap enable yes || exit 0
rcService openldap active no && exit 0
openldap_signal INT
sleep 2
%restart -u @l_susr@
rcService openldap enable yes || exit 0
rcService openldap active no && exit 0
rc openldap stop start
23 years ago
%daily -u @l_susr@
rcService openldap enable yes || exit 0
23 years ago
# 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 \
23 years ago
-P "${openldap_log_prolog}" \
-E "${openldap_log_epilog} && rc openldap restart" \
23 years ago
@l_prefix@/var/openldap/openldap.log