dovecot/rc.dovecot

Sat, 21 May 2011 22:05:42 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 21 May 2011 22:05:42 +0200
changeset 340
870131689a5c
parent 148
f6edc24e328f
permissions
-rw-r--r--

Correct diverse buildconf of upstream release and reconcile packaging somewhat.
These changes stem from the obvious changes in the latest vendor release, but
from discussions with trolls Daniel and Oswald as well regarding build config.

This commital follows conclusion of buildconf adjustments to allow the new
vendor version to build on Linux AMD64, but is incomplete as many packaging
comments show. The next series of changes focus on Solaris IA32 and reduction
of buildconf adjustments testing old problems comprehensively in anticipation
of discussion at the upcoming Nokia Contributor Summit in Berlin.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.dovecot -- Run-Commands
     4 ##
     6 %config
     7     dovecot_enable="$openpkg_rc_def"
     8     dovecot_log_prolog="true"
     9     dovecot_log_epilog="true"
    10     dovecot_log_numfiles="10"
    11     dovecot_log_minsize="1M"
    12     dovecot_log_complevel="9"
    13     dovecot_deliver_log_prolog="true"
    14     dovecot_deliver_log_epilog="true"
    15     dovecot_deliver_log_numfiles="10"
    16     dovecot_deliver_log_minsize="1M"
    17     dovecot_deliver_log_complevel="9"
    19 %common
    20     dovecot_pidfile="@l_prefix@/var/dovecot/run/master.pid"
    21     dovecot_signal () {
    22         [ -f $dovecot_pidfile ] && kill -$1 `cat $dovecot_pidfile`
    23     }
    25 %status -u @l_susr@ -o
    26     dovecot_usable="unknown"
    27     dovecot_active="no"
    28     rcService dovecot enable yes && \
    29         dovecot_signal 0 && dovecot_active="yes"
    30     echo "dovecot_enable=\"$dovecot_enable\""
    31     echo "dovecot_usable=\"$dovecot_usable\""
    32     echo "dovecot_active=\"$dovecot_active\""
    34 %start -u @l_susr@
    35     rcService dovecot enable yes || exit 0
    36     rcService dovecot active yes && exit 0
    37     @l_prefix@/sbin/dovecot
    39 %stop -u @l_susr@
    40     rcService dovecot enable yes || exit 0
    41     rcService dovecot active no  && exit 0
    42     dovecot_signal TERM
    43     sleep 2
    44     rm -f $dovecot_pidfile >/dev/null 2>&1 || true
    46 %restart -u @l_susr@
    47     rcService dovecot enable yes || exit 0
    48     rcService dovecot active no  && exit 0
    49     rc dovecot stop start
    51 %reload -u @l_susr@
    52     rcService dovecot enable yes || exit 0
    53     rcService dovecot active no  && exit 0
    54     dovecot_signal HUP
    56 %daily -u @l_susr@
    57     rcService dovecot enable yes || exit 0
    58     rcTmp -i
    59     hintfile=`rcTmp -f -n hint`
    60     shtool rotate -f \
    61         -n ${dovecot_log_numfiles} -s ${dovecot_log_minsize} -d \
    62         -z ${dovecot_log_complevel} -m 600 -o @l_susr@ -g @l_sgrp@ \
    63         -P "${dovecot_log_prolog}" \
    64         -E "${dovecot_log_epilog}; echo 1 >$hintfile" \
    65         @l_prefix@/var/dovecot/log/dovecot.log
    66     if [ -s $hintfile ]; then
    67         dovecot_signal USR1
    68     fi
    69     rcTmp -k
    70     shtool rotate -f \
    71         -n ${dovecot_deliver_log_numfiles} -s ${dovecot_deliver_log_minsize} -d \
    72         -z ${dovecot_deliver_log_complevel} -m 600 -o @l_rusr@ -g @l_rgrp@ \
    73         -P "${dovecot_deliver_log_prolog}" \
    74         -E "${dovecot_deliver_log_epilog}" \
    75         @l_prefix@/var/dovecot/log/deliver.log

mercurial