postfix/rc.postfix

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
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.postfix -- Run-Commands
     4 ##
     6 %config
     7     MTA_name="postfix"
     8     MTA_aliases_file="@l_prefix@/etc/postfix/aliases"
     9     MTA_aliases_update="cd @l_prefix@/etc/postfix && @l_prefix@/sbin/postalias aliases"
    10     postfix_enable="$openpkg_rc_def"
    11     postfix_log_prolog="true"
    12     postfix_log_epilog="true"
    13     postfix_log_numfiles="10"
    14     postfix_log_minsize="1M"
    15     postfix_log_complevel="9"
    16     postfix_sum_flags=""
    18 %status -u @l_susr@ -o
    19     postfix_usable="no"
    20     postfix_active="no"
    21     @l_prefix@/sbin/postfix check >/dev/null 2>&1 && postfix_usable="yes"
    22     @l_prefix@/libexec/postfix/master -t >/dev/null 2>&1 || postfix_active="yes"
    23     echo "postfix_enable=\"$postfix_enable\""
    24     echo "postfix_usable=\"$postfix_usable\""
    25     echo "postfix_active=\"$postfix_active\""
    27 %start -u @l_susr@
    28     rcService postfix enable yes || exit 0
    29     rcService postfix active yes && exit 0
    30     @l_prefix@/sbin/postfix start
    32 %stop -u @l_susr@
    33     rcService postfix enable yes || exit 0
    34     rcService postfix active no  && exit 0
    35     @l_prefix@/sbin/postfix stop
    36     sleep 2
    38 %restart -u @l_susr@
    39     rcService postfix enable yes || exit 0
    40     rcService postfix active no  && exit 0
    41     rc postfix stop start
    43 %reload -u @l_susr@
    44     rcService postfix enable yes || exit 0
    45     rcService postfix active no  && exit 0
    46     @l_prefix@/sbin/postfix reload
    48 %daily -u @l_susr@
    49     rcService postfix enable yes || exit 0
    51     #   rotate summary logfile
    52     shtool rotate -f \
    53         -n ${postfix_log_numfiles} -s 0 \
    54         -z ${postfix_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \
    55         @l_prefix@/var/postfix/log/postfix.sum
    57     #   generate summary logfile
    58     logfiles="@l_prefix@/var/postfix/log/postfix.log"
    59     if [ -f "@l_prefix@/var/postfix/log/postfix.log.0" ]; then
    60         logfiles="$logfiles @l_prefix@/var/postfix/log/postfix.log.0"
    61     fi
    62     @l_prefix@/sbin/pflogsumm -d yesterday -h 10 -u 10 -i \
    63         --iso_date_time --problems_first --smtpd_stats --verbose_msg_detail \
    64         ${postfix_sum_flags} \
    65         ${logfiles} >@l_prefix@/var/postfix/log/postfix.sum 2>/dev/null
    67     #   rotate logfile
    68     shtool rotate -f \
    69         -n ${postfix_log_numfiles} -s ${postfix_log_minsize} -d \
    70         -z ${postfix_log_complevel} -m 644 -o @l_musr@ -g @l_mgrp@ \
    71         -P "$postfix_log_prolog" \
    72         -E "$postfix_log_epilog" \
    73         @l_prefix@/var/postfix/log/postfix.log

mercurial