sasl/rc.sasl

Wed, 08 Feb 2012 20:07:00 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 08 Feb 2012 20:07:00 +0200
changeset 588
300d43423c2e
permissions
-rw-r--r--

Update version, adapt patch, correct PID writing, correct build on newer
FreeBSD releases, and most importantly introduce new patch to try to
avoid segfault caused by multiple network interfaces with the same (or
no) address. This is common when configuring bridges and tunnels.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.sasl -- Run-Commands
     4 ##
     6 %config
     7     sasl_enable="$openpkg_rc_def"
     8     sasl_flags=""
     9     sasl_authmech="@l_authmech@"
    10     sasl_threads="4"
    11     sasl_log_prolog="true"
    12     sasl_log_epilog="true"
    13     sasl_log_numfiles="10"
    14     sasl_log_minsize="1M"
    15     sasl_log_complevel="9"
    17 %common
    18     sasl_pidfile="@l_prefix@/var/sasl/run/saslauthd/saslauthd.pid"
    19     sasl_signal () {
    20         [ -f $sasl_pidfile ] && kill -$1 `cat $sasl_pidfile`
    21     }
    23 %status -u @l_susr@ -o
    24     sasl_usable="unknown"
    25     sasl_active="no"
    26     rcService sasl enable yes && \
    27         sasl_signal 0 && sasl_active="yes"
    28     echo "sasl_enable=\"$sasl_enable\""
    29     echo "sasl_usable=\"$sasl_usable\""
    30     echo "sasl_active=\"$sasl_active\""
    32 %start -p 400 -u @l_susr@
    33     rcService sasl enable yes || exit 0
    34     rcService sasl active yes && exit 0
    35     @l_prefix@/sbin/saslauthd \
    36         -a "${sasl_authmech}" \
    37         -n "${sasl_threads}" \
    38         ${sasl_flags}
    40 %stop -p 600 -u @l_susr@
    41     rcService sasl enable yes || exit 0
    42     rcService sasl active no && exit 0
    43     sasl_signal TERM
    45 %restart -u @l_susr@
    46     rcService sasl enable yes || exit 0
    47     rcService sasl active no && exit 0
    48     rc sasl stop
    49     sleep 2
    50     rc sasl start
    52 %daily -u @l_susr@
    53     rcService sasl enable yes || exit 0
    54     shtool rotate -f \
    55         -n ${sasl_log_numfiles} -s ${sasl_log_minsize} -d \
    56         -z ${sasl_log_complevel} -o @l_susr@ -g @l_sgrp@ -m 600 \
    57         -P "${sasl_log_prolog}" \
    58         -E "${sasl_log_epilog}; rc sasl restart" \
    59         @l_prefix@/var/sasl/log/saslauthd.log

mercurial