#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
##  rc.sasl -- Run-Commands for Cyrus SASL
##

%config
    sasl_enable="yes"
    sasl_authmech="@authmech@"
    sasl_threads="5"

%start -p 200 -u root
    if opServiceEnabled sasl; then
        @l_prefix@/sbin/saslauthd -a ${sasl_authmech} -n ${sasl_threads}
    fi

%stop -p 200 -u root
    if opServiceEnabled sasl; then
        if [ -f @l_prefix@/var/sasl/saslauthd/mux.pid ]; then
            kill -TERM `cat @l_prefix@/var/sasl/saslauthd/mux.pid`
        fi
    fi

