proftpd/rc.proftpd

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@182 1 #!@l_prefix@/bin/openpkg rc
michael@182 2 ##
michael@182 3 ## rc.proftpd -- Run-Commands
michael@182 4 ##
michael@182 5
michael@182 6 %config
michael@182 7 proftpd_enable="$openpkg_rc_def"
michael@182 8 proftpd_nice="0"
michael@182 9 proftpd_acc_file="@l_prefix@/var/proftpd/proftpd.access.log"
michael@182 10 proftpd_acc_prolog="true"
michael@182 11 proftpd_acc_epilog="true"
michael@182 12 proftpd_acc_numfiles="10"
michael@182 13 proftpd_acc_minsize="1M"
michael@182 14 proftpd_acc_complevel="9"
michael@182 15 proftpd_auth_file="@l_prefix@/var/proftpd/proftpd.auth.log"
michael@182 16 proftpd_auth_prolog="true"
michael@182 17 proftpd_auth_epilog="true"
michael@182 18 proftpd_auth_numfiles="10"
michael@182 19 proftpd_auth_minsize="1M"
michael@182 20 proftpd_auth_complevel="9"
michael@182 21 proftpd_sys_file="@l_prefix@/var/proftpd/proftpd.system.log"
michael@182 22 proftpd_sys_prolog="true"
michael@182 23 proftpd_sys_epilog="true"
michael@182 24 proftpd_sys_numfiles="10"
michael@182 25 proftpd_sys_minsize="1M"
michael@182 26 proftpd_sys_complevel="9"
michael@182 27 proftpd_xfer_file="@l_prefix@/var/proftpd/proftpd.xfer.log"
michael@182 28 proftpd_xfer_prolog="true"
michael@182 29 proftpd_xfer_epilog="true"
michael@182 30 proftpd_xfer_numfiles="10"
michael@182 31 proftpd_xfer_minsize="1M"
michael@182 32 proftpd_xfer_complevel="9"
michael@182 33
michael@182 34 %common
michael@182 35 proftpd_pidfile="@l_prefix@/var/proftpd/proftpd.pid"
michael@182 36 proftpd_signal () {
michael@182 37 [ -f $proftpd_pidfile ] && kill -$1 `cat $proftpd_pidfile`
michael@182 38 }
michael@182 39
michael@182 40 %status -u @l_susr@ -o
michael@182 41 proftpd_usable="unknown"
michael@182 42 proftpd_active="no"
michael@182 43 rcService proftpd enable yes && \
michael@182 44 proftpd_signal 0 && proftpd_active="yes"
michael@182 45 echo "proftpd_enable=\"$proftpd_enable\""
michael@182 46 echo "proftpd_usable=\"$proftpd_usable\""
michael@182 47 echo "proftpd_active=\"$proftpd_active\""
michael@182 48
michael@182 49 %start -u @l_susr@
michael@182 50 rcService proftpd enable yes || exit 0
michael@182 51 rcService proftpd active yes && exit 0
michael@182 52 nice -n $proftpd_nice @l_prefix@/sbin/proftpd
michael@182 53
michael@182 54 %stop -u @l_susr@
michael@182 55 rcService proftpd enable yes || exit 0
michael@182 56 rcService proftpd active no && exit 0
michael@182 57 proftpd_signal TERM
michael@182 58 sleep 2
michael@182 59
michael@182 60 %restart -u @l_susr@
michael@182 61 rcService proftpd enable yes || exit 0
michael@182 62 rcService proftpd active no && exit 0
michael@182 63 rc proftpd stop start
michael@182 64
michael@182 65 %reload -u @l_susr@
michael@182 66 rcService proftpd enable yes || exit 0
michael@182 67 proftpd_signal HUP
michael@182 68
michael@182 69 %daily -u @l_susr@
michael@182 70 rcService proftpd enable yes || exit 0
michael@182 71 rcTmp -i
michael@182 72 hintfile=`rcTmp -f -n hint`
michael@182 73 shtool rotate -f \
michael@182 74 -n ${proftpd_acc_numfiles} -s ${proftpd_acc_minsize} -d \
michael@182 75 -z ${proftpd_acc_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@182 76 -P "${proftpd_acc_prolog}" \
michael@182 77 -E "${proftpd_acc_epilog}; echo 1 >$hintfile" \
michael@182 78 ${proftpd_acc_file}
michael@182 79 shtool rotate -f \
michael@182 80 -n ${proftpd_auth_numfiles} -s ${proftpd_auth_minsize} -d \
michael@182 81 -z ${proftpd_auth_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@182 82 -P "${proftpd_auth_prolog}" \
michael@182 83 -E "${proftpd_auth_epilog}; echo 1 >$hintfile" \
michael@182 84 ${proftpd_auth_file}
michael@182 85 shtool rotate -f \
michael@182 86 -n ${proftpd_sys_numfiles} -s ${proftpd_sys_minsize} -d \
michael@182 87 -z ${proftpd_sys_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@182 88 -P "${proftpd_sys_prolog}" \
michael@182 89 -E "${proftpd_sys_epilog}; echo 1 >$hintfile" \
michael@182 90 ${proftpd_sys_file}
michael@182 91 shtool rotate -f \
michael@182 92 -n ${proftpd_xfer_numfiles} -s ${proftpd_xfer_minsize} -d \
michael@182 93 -z ${proftpd_xfer_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@182 94 -P "${proftpd_xfer_prolog}" \
michael@182 95 -E "${proftpd_xfer_epilog}; echo 1 >$hintfile" \
michael@182 96 ${proftpd_xfer_file}
michael@182 97 if [ -s $hintfile ]; then
michael@182 98 rc proftpd restart
michael@182 99 fi
michael@182 100 rcTmp -k
michael@182 101

mercurial