aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorzi <zi@FreeBSD.org>2011-08-19 21:02:39 +0800
committerzi <zi@FreeBSD.org>2011-08-19 21:02:39 +0800
commita30f9852e682193cd91b036cedd5ef2a867ac787 (patch)
treef0e6e2942b465e0cf0397097487a23d307c7a57b /security
parent1dae982360855bdeb6054568e1d875c48bede02b (diff)
downloadfreebsd-ports-gnome-a30f9852e682193cd91b036cedd5ef2a867ac787.tar.gz
freebsd-ports-gnome-a30f9852e682193cd91b036cedd5ef2a867ac787.tar.zst
freebsd-ports-gnome-a30f9852e682193cd91b036cedd5ef2a867ac787.zip
Add support for running multiple instances
Adjust whitespace in Makefile PR: ports/159892 Submitted by: Paul Schmehl <pauls@utdallas.edu> (maintainer) Approved by: tabthorpe (mentor)
Diffstat (limited to 'security')
-rw-r--r--security/barnyard2/Makefile6
-rw-r--r--security/barnyard2/files/barnyard2.sh.in61
2 files changed, 23 insertions, 44 deletions
diff --git a/security/barnyard2/Makefile b/security/barnyard2/Makefile
index 7efeb3c42d14..52c01ab75f82 100644
--- a/security/barnyard2/Makefile
+++ b/security/barnyard2/Makefile
@@ -46,17 +46,17 @@ CONFIGURE_ARGS+= --with-postgresql
.endif
.if defined(WITH_SNORT)
-RUN_DEPENDS+= ${LOCALBASE}/bin/snort:${PORTSDIR}/security/snort
+RUN_DEPENDS+= ${LOCALBASE}/bin/snort:${PORTSDIR}/security/snort
.endif
.if defined(WITH_SURICATA)
-RUN_DEPENDS+= ${LOCALBASE}/bin/suricata:${PORTSDIR}/security/suricata
+RUN_DEPENDS+= ${LOCALBASE}/bin/suricata:${PORTSDIR}/security/suricata
.endif
.if defined(WITH_TCL)
USE_TCL= yes
CONFIGURE_ARGS+= --with-tcl=${PREFIX}/lib/tcl8.4
-LIB_DEPENDS+= tcl84.1:${PORTSDIR}/lang/tcl84
+LIB_DEPENDS+= tcl84.1:${PORTSDIR}/lang/tcl84
.endif
pre-install:
diff --git a/security/barnyard2/files/barnyard2.sh.in b/security/barnyard2/files/barnyard2.sh.in
index a99e5a70450e..043461583ab9 100644
--- a/security/barnyard2/files/barnyard2.sh.in
+++ b/security/barnyard2/files/barnyard2.sh.in
@@ -13,52 +13,18 @@
# Default: -D
# barnyard2_conf (str): Barnyard configuration file
# Default: %%PREFIX%%/etc/barnyard2.conf
+# optional, multi-barnyard2:
+# barnyard2_rules="1 2 3"
+# barnyard2_1_flags="-D"
+# barnyard2_1_pidfile=""
+# #$command $flags $args
#
# USAGE: barnyard2 [-options]
#
-# General Options:
-# -? Show this information
-# -c <file> Use configuration file <file>
-# -g <gname> Run barnyard gid as <gname> group (or gid) after initialization
-# -m <umask> Set umask = <umask>
-# -q Quiet. Don't show banner and status report
-# -u <uname> Run barnyard uid as <uname> user (or uid) after initialization
-# -v Be verbose
-# -C <file> Read the classification map from <file>
-# -D Run barnyard in background (daemon) mode
-# -G <file> Read the gen-msg map from <file>
-# -L <dir> Write output files in <dir>
-# -R <file> Read the reference map from <file>
-# -S <file> Read the sid-msg map from <file>
-# -T Test and report on the current configuration
-# -U Use UTC for timestamps
-# -V Show version and exit
-#
-# Continual Processing Options:
-# -a <dir> Archive processed files to <dir>
-# -f <base> Use <base> as the base filename pattern
-# -d <dir> Spool files from <dir>
-# -n Only process new events
-# -w <file> Enable bookmarking using <file>
-#
-# Batch Processing Mode Options:
-# -o Enable batch processing mode
-#
-# Longname options and their corresponding single char version
-# --reference <file> Same as -R
-# --classification <file> Same as -C
-# --gen-msg <file> Same as -G
-# --sid-msg <file> Same as -S
-# --pid-path <path> Specify the path for the barnyard PID file
-# --create-pidfile Create PID file, even when not in Daemon mode
-# --nolock-pidfile Do not try to lock barnyard PID file
-# --help Same as -?
-# --version Same as -V
. /etc/rc.subr
name="barnyard2"
-load_rc_config $name
rcvar=`set_rcvar`
# set some defaults
: ${barnyard2_enable="NO"}
@@ -66,6 +32,19 @@ rcvar=`set_rcvar`
: ${barnyard2_flags="-D"}
command="%%PREFIX%%/bin/barnyard2"
-command_args="-c ${barnyard2_conf} ${barnyard2_flags}"
+command_args="-c ${barnyard2_conf} -D"
+
+load_rc_config $name
-run_rc_command "$1"
+if [ -n "${barnyard2_rules}" ];then
+ for i in ${barnyard2_rules}; do
+ echo -n "$i:"
+ eval barnyard2_flags=\$barnyard2_${i}_flags
+ eval pidfile=\$barnyard2_${i}_pidfile
+ eval barnyard2_conf=\$barnyard2_${i}_conf
+ command_args="-c $barnyard2_conf -D"
+ run_rc_command "$1"
+ done
+else
+ run_rc_command "$1"
+fi