arpwatch/rc.arpwatch

Fri, 16 Jan 2009 10:58:21 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2009 10:58:21 +0100
changeset 92
645923d1e875
child 571
175768f4868b
permissions
-rw-r--r--

Correct and improve code logic, buildconf, and packaging. In particular:
1. Use descriptive variable names <var>libs instead of just <var>.
2. Although Nokia states in all Qt builds that 'NOTE: When linking
against OpenSSL, you can override the default library names
through OPENSSL_LIBS.' and even gives an example, their own
configuration logic rejects such an attempt. Correct this by
hard coding the OpenSSL library string in the configure script.
3. Consistently use the whitespace substitution [\t ] throughout.
4. Patch the buggy INCPATH of SQL plugin Qmake project files.
5. Add the 'x11' configuration variable to the qtconfig Qmake
project using the src/gui/gui.pro file as a model. This is
needed for qtconfig although not in other tools, because
the qtconfig buildconf indirectly includes qt_x11_p.h which
is dependent on X11 headers.
6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow'
on platforms for which the config.tests/unix/[3dnow|sse2] succeed
although unsopported at run time by testing for the x86-64
instruction set at build time and regulating hardware capabilities.
7. Correctly install the desinger plugin by explicitly building it.
8. Remove custom plugin installation logic which is unnecessary.
9. Correct removal of temporary paths from shared object files.

michael@64 1 #!@l_prefix@/bin/openpkg rc
michael@64 2 ##
michael@64 3 ## rc.arpwatch -- runcommands
michael@64 4 ##
michael@64 5
michael@64 6 %config
michael@64 7 arpwatch_enable="$openpkg_rc_def"
michael@64 8 arpwatch_log_prolog="true"
michael@64 9 arpwatch_log_epilog="true"
michael@64 10 arpwatch_log_numfiles="10"
michael@64 11 arpwatch_log_minsize="1M"
michael@64 12 arpwatch_log_complevel="9"
michael@64 13 arpwatch_iface="-i lo0"
michael@64 14 arpwatch_ipnet="-n 127.0.0.0/8"
michael@64 15
michael@64 16 %common
michael@64 17 arpwatch_pidfile="@l_prefix@/var/arpwatch/run/arpwatch.pid"
michael@64 18 arpwatch_signal () {
michael@64 19 [ -f $arpwatch_pidfile ] && kill -$1 `cat $arpwatch_pidfile`
michael@64 20 }
michael@64 21
michael@64 22 %status -u @l_susr@ -o
michael@64 23 arpwatch_usable="no"
michael@64 24 arpwatch_active="no"
michael@64 25 rcService arpwatch enable yes && \
michael@64 26 arpwatch_usable="yes"
michael@64 27 rcService arpwatch enable yes && \
michael@64 28 arpwatch_signal 0 && arpwatch_active="yes"
michael@64 29 echo "arpwatch_enable=\"$arpwatch_enable\""
michael@64 30 echo "arpwatch_usable=\"$arpwatch_usable\""
michael@64 31 echo "arpwatch_active=\"$arpwatch_active\""
michael@64 32
michael@64 33 %start -u @l_susr@
michael@64 34 rcService arpwatch enable yes || exit 0
michael@64 35 rcService arpwatch active yes && exit 0
michael@64 36 @l_prefix@/sbin/arpwatch \
michael@64 37 $arpwatch_iface \
michael@64 38 $arpwatch_ipnet \
michael@64 39 >$arpwatch_pidfile 2>&1
michael@64 40
michael@64 41 %stop -u @l_susr@
michael@64 42 rcService arpwatch enable yes || exit 0
michael@64 43 rcService arpwatch active no && exit 0
michael@64 44 arpwatch_signal TERM
michael@64 45
michael@64 46 %restart -u @l_susr@
michael@64 47 rcService arpwatch enable yes || exit 0
michael@64 48 rcService arpwatch active no && exit 0
michael@64 49 rc arpwatch stop
michael@64 50 sleep 2
michael@64 51 rc arpwatch start
michael@64 52
michael@64 53 %reload -u @l_susr@
michael@64 54 rcService arpwatch enable yes || exit 0
michael@64 55 rcService arpwatch active no && exit 0
michael@64 56 arpwatch_signal HUP
michael@64 57
michael@64 58 %daily -u @l_susr@
michael@64 59 rcService arpwatch enable yes || exit 0
michael@64 60 shtool rotate -f \
michael@64 61 -n ${arpwatch_log_numfiles} -s ${arpwatch_log_minsize} -d \
michael@64 62 -z ${arpwatch_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
michael@64 63 -P "${arpwatch_log_prolog}" \
michael@64 64 -E "${arpwatch_log_epilog}; rc arpwatch restart" \
michael@64 65 @l_prefix@/var/arpwatch/log/arpwatch.log \
michael@64 66 @l_prefix@/var/arpwatch/log/arpsnmp.log

mercurial