jabberd/rc.jabberd

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
parent 224
29b273d63835
child 364
fa25ea0595ef
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@224 1 #!@l_prefix@/bin/openpkg rc
michael@224 2 ##
michael@224 3 ## rc.jabberd -- Run-Commands
michael@224 4 ##
michael@224 5
michael@224 6 %config
michael@224 7 jabberd_enable="$openpkg_rc_def"
michael@224 8 jabberd_hostname=`hostname`
michael@225 9 jabberd_daemons="c2s router s2s sm"
michael@224 10 jabberd_cfgfile="@l_prefix@/etc/jabberd/jabberd.cfg"
michael@224 11 jabberd_log_prolog="true"
michael@224 12 jabberd_log_epilog="true"
michael@224 13 jabberd_log_numfiles="10"
michael@224 14 jabberd_log_minsize="1M"
michael@224 15 jabberd_log_complevel="9"
michael@224 16
michael@224 17 %common
michael@224 18 jabberd_signal () {
michael@224 19 local retcode=0
michael@224 20 local daemons=
michael@224 21 for daemons in $jabberd_daemons; do
michael@224 22 [ -f @l_prefix@/var/jabberd/pid/${daemons}.pid ] \
michael@224 23 && kill -$1 `cat @l_prefix@/var/jabberd/pid/${daemons}.pid`
michael@224 24 retcode=$(($retcode+$?))
michael@224 25 done
michael@224 26 return $retcode
michael@224 27 }
michael@224 28
michael@224 29 %status -u @l_nusr@ -o
michael@224 30 jabberd_usable="unknown"
michael@224 31 jabberd_active="no"
michael@224 32 rcService jabberd enable yes && \
michael@224 33 jabberd_signal 0 && jabberd_active="yes"
michael@224 34 echo "jabberd_enable=\"$jabberd_enable\""
michael@224 35 echo "jabberd_usable=\"$jabberd_usable\""
michael@224 36 echo "jabberd_active=\"$jabberd_active\""
michael@224 37
michael@224 38 %start -u @l_nusr@
michael@224 39 rcService jabberd enable yes || exit 0
michael@224 40 rcService jabberd active yes && exit 0
michael@224 41 @l_prefix@/bin/jabberd -b -c $jabberd_cfgfile
michael@224 42
michael@224 43 %stop -u @l_nusr@
michael@224 44 rcService jabberd enable yes || exit 0
michael@224 45 rcService jabberd active no && exit 0
michael@224 46 jabberd_signal TERM
michael@224 47 sleep 2
michael@224 48 for daemons in $jabberd_daemons; do
michael@224 49 rm -f @l_prefix@/var/jabberd/pid/${daemons}.pid
michael@224 50 done
michael@224 51
michael@224 52 %restart -u @l_nusr@
michael@224 53 rcService jabberd enable yes || exit 0
michael@224 54 rcService jabberd active no && exit 0
michael@224 55 rc jabberd stop
michael@224 56 sleep 2
michael@224 57 rc jabberd start
michael@224 58
michael@224 59 %daily -u @l_susr@
michael@224 60 rcService jabberd enable yes || exit 0
michael@224 61 logfiles=
michael@224 62 for daemons in $jabberd_daemons; do
michael@224 63 logfiles="$logfiles @l_prefix@/var/jabberd/log/$daemons.log"
michael@224 64 done
michael@224 65 shtool rotate -f \
michael@224 66 -n ${jabberd_log_numfiles} -s ${jabberd_log_minsize} -d \
michael@224 67 -z ${jabberd_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@224 68 -P "${jabberd_log_prolog}" \
michael@224 69 -E "${jabberd_log_epilog}; rc jabberd restart" \
michael@224 70 $logfiles
michael@224 71

mercurial