postfix/rc.postfix

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

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

mercurial