From e1e65173efae17ea2f15a5b43a6b70cf2904bc89 Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Wed, 16 Feb 2005 21:57:04 +0000 Subject: [PATCH] fix building --- flowtools/flowtools.spec | 4 +-- flowtools/rc.flowtools | 53 ++++++++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 18 deletions(-) diff --git a/flowtools/flowtools.spec b/flowtools/flowtools.spec index 40986c7686..ec4be9f134 100644 --- a/flowtools/flowtools.spec +++ b/flowtools/flowtools.spec @@ -39,7 +39,7 @@ Class: EVAL Group: Network License: BSD Version: %{V_flowtools} -Release: 20041225 +Release: 20050216 # package options %option with_fsl yes @@ -153,7 +153,7 @@ AutoReqProv: no # build flow-extract addon ( cd flowextract-%{V_flowextract} - INCLUDES="-I../flow-tools-%{V_flowtools}/lib" + INCLUDES="-I../flow-tools-%{V_flowtools}/lib %{l_cppflags}" LIBS="-L../flow-tools-%{V_flowtools}/lib %{l_ldflags} -lft -lz" case "%{l_platform -t}" in *-sunos* ) LIBS="$LIBS -lsocket -lnsl" ;; diff --git a/flowtools/rc.flowtools b/flowtools/rc.flowtools index d318f6c263..7765553e78 100644 --- a/flowtools/rc.flowtools +++ b/flowtools/rc.flowtools @@ -5,10 +5,13 @@ %config flowtools_enable="$openpkg_rc_def" + flowtools_fanout="no" + flowtools_fanout_flags="-S5 -V5" + flowtools_fanout_listen="127.0.0.1/0/4433 0/127.0.0.1/4434 0/127.0.0.1/4435" flowtools_capture="no" - flowtools_capture_flags="-V5 -N-1 -n95 -e665 -z4 -S5" - flowtools_capture_workdir="@l_prefix@/var/flowtools/db" + flowtools_capture_flags="-S5 -V5 -N-1 -n95 -e665 -z4" flowtools_capture_listen="127.0.0.1/0/4432" + flowtools_capture_workdir="@l_prefix@/var/flowtools/db" flowtools_capture_log_prolog="true" flowtools_capture_log_epilog="true" flowtools_capture_log_numfiles="10" @@ -16,8 +19,12 @@ flowtools_capture_log_complevel="9" %common - flowtools_capture_logfile="@l_prefix@/var/flowtools/flowtools.log" - flowtools_capture_pidfile="@l_prefix@/var/flowtools/flowtools.pid" + flowtools_logfile="@l_prefix@/var/flowtools/flowtools.log" + flowtools_fanout_pidfile="@l_prefix@/var/flowtools/flow-fanout.pid" + flowtools_fanout_signal () { + [ -f $flowtools_fanout_pidfile ] && kill -$1 `cat $flowtools_fanout_pidfile` + } + flowtools_capture_pidfile="@l_prefix@/var/flowtools/flow-capture.pid" flowtools_capture_signal () { [ -f $flowtools_capture_pidfile ] && kill -$1 `cat $flowtools_capture_pidfile` } @@ -25,6 +32,8 @@ %status -u @l_rusr@ -o flowtools_usable="unknown" flowtools_active="no" + rcService flowtools enable yes && rcVarIsYes flowtools_fanout && \ + flowtools_fanout_signal 0 && flowtools_active="yes" rcService flowtools enable yes && rcVarIsYes flowtools_capture && \ flowtools_capture_signal 0 && flowtools_active="yes" echo "flowtools_enable=\"$flowtools_enable\"" @@ -34,25 +43,37 @@ %start -u @l_rusr@ rcService flowtools enable yes || exit 0 rcService flowtools active yes && exit 0 - rcVarIsYes flowtools_capture || exit 0 - eval @l_prefix@/bin/flow-capture \ - $flowtools_capture_flags \ - -p "$flowtools_capture_pidfile" \ - -w "$flowtools_capture_workdir" \ - "$flowtools_capture_listen" + if rcVarIsYes flowtools_fanout; then + eval @l_prefix@/bin/flow-fanout \ + $flowtools_fanout_flags \ + -p "$flowtools_fanout_pidfile" \ + "$flowtools_fanout_listen" + fi + if rcVarIsYes flowtools_capture; then + eval @l_prefix@/bin/flow-capture \ + $flowtools_capture_flags \ + -p "$flowtools_capture_pidfile" \ + -w "$flowtools_capture_workdir" \ + "$flowtools_capture_listen" + fi %stop -u @l_rusr@ rcService flowtools enable yes || exit 0 rcService flowtools active no && exit 0 - rcVarIsYes flowtools_capture || exit 0 - flowtools_capture_signal TERM - sleep 2 - rm -f $flowtools_capture_pidfile + if rcVarIsYes flowtools_fanout; then + flowtools_fanout_signal TERM + sleep 2 + rm -f $flowtools_fanout_pidfile + fi + if rcVarIsYes flowtools_capture; then + flowtools_capture_signal TERM + sleep 2 + rm -f $flowtools_capture_pidfile + fi %restart -u @l_rusr@ rcService flowtools enable yes || exit 0 rcService flowtools active no && exit 0 - rcVarIsYes flowtools_capture || exit 0 rc flowtools stop start %daily -u @l_rusr@ @@ -64,5 +85,5 @@ -z ${flowtools_capture_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \ -P "${flowtools_capture_log_prolog}" \ -E "${flowtools_capture_log_epilog}; rc flowtools restart" \ - $flowtools_capture_logfile + $flowtools_logfile