nessus-tool/rc.nessus

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@102 1 #!@l_prefix@/bin/openpkg rc
michael@102 2 ##
michael@102 3 ## rc.nessus -- Run-Commands
michael@102 4 ##
michael@102 5
michael@102 6 %config
michael@102 7 nessus_enable="$openpkg_rc_def"
michael@102 8 nessus_listen_addr="127.0.0.1"
michael@102 9 nessus_listen_port="1241"
michael@102 10 nessus_source_addr="127.0.0.1"
michael@102 11 nessus_log_prolog="true"
michael@102 12 nessus_log_epilog="true"
michael@102 13 nessus_log_numfiles="10"
michael@102 14 nessus_log_minsize="1M"
michael@102 15 nessus_log_complevel="9"
michael@102 16
michael@102 17 %common
michael@102 18 nessus_pidfile="@l_prefix@/var/nessus/nessusd.pid"
michael@102 19 nessus_signal () {
michael@102 20 [ -f $nessus_pidfile ] && kill -$1 `cat $nessus_pidfile`
michael@102 21 }
michael@102 22
michael@102 23 %status -u @l_susr@ -o
michael@102 24 nessus_usable="unknown"
michael@102 25 nessus_active="no"
michael@102 26 rcService nessus enable yes && \
michael@102 27 nessus_signal 0 && nessus_active="yes"
michael@102 28 echo "nessus_enable=\"$nessus_enable\""
michael@102 29 echo "nessus_usable=\"$nessus_usable\""
michael@102 30 echo "nessus_active=\"$nessus_active\""
michael@102 31
michael@102 32 %start -p 900 -u @l_susr@
michael@102 33 rcService nessus enable yes || exit 0
michael@102 34 rcService nessus active yes && exit 0
michael@102 35 @l_prefix@/sbin/nessusd \
michael@102 36 --listen="${nessus_listen_addr}" \
michael@102 37 --port="${nessus_listen_port}" \
michael@102 38 --src-ip="${nessus_source_addr}" \
michael@102 39 --background
michael@102 40
michael@102 41 %stop -p 100 -u @l_susr@
michael@102 42 rcService nessus enable yes || exit 0
michael@102 43 rcService nessus active no && exit 0
michael@102 44 nessus_signal TERM
michael@102 45 sleep 2
michael@102 46
michael@102 47 %restart -p 900 -u @l_susr@
michael@102 48 rcService nessus enable yes || exit 0
michael@102 49 rcService nessus active no && exit 0
michael@102 50 rc nessus stop start
michael@102 51
michael@102 52 %daily -u @l_susr@
michael@102 53 rcService nessus enable yes || exit 0
michael@102 54 shtool rotate -f \
michael@102 55 -n ${nessus_log_numfiles} -s ${nessus_log_minsize} -d \
michael@102 56 -z ${nessus_log_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \
michael@102 57 -P "${nessus_log_prolog}" \
michael@102 58 -E "${nessus_log_epilog}; rc nessus restart" \
michael@102 59 @l_prefix@/var/nessus/logs/nessusd.log
michael@102 60

mercurial