aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-10-26 21:29:03 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-10-26 21:29:03 +0000
commit0af8af96a2cb74803f8a89edaa3460d208694616 (patch)
treea5a0c07126d334eec820eb1f591b31127e4a35ef
parenta563efd57213a312e3a5611da0b09c52612b2026 (diff)
downloadpfsense-packages-0af8af96a2cb74803f8a89edaa3460d208694616.tar.gz
pfsense-packages-0af8af96a2cb74803f8a89edaa3460d208694616.tar.bz2
pfsense-packages-0af8af96a2cb74803f8a89edaa3460d208694616.zip
Note the snort performance mode on startup
-rw-r--r--packages/snort/snort.inc8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc
index 81957c2e..62dd8008 100644
--- a/packages/snort/snort.inc
+++ b/packages/snort/snort.inc
@@ -50,6 +50,12 @@ function sync_package_snort() {
$bpfmaxbufsize = $config['installedpackages']['snortadvanced']['config'][0]['bpfmaxbufsize'];
$bpfmaxinsns = $config['installedpackages']['snortadvanced']['config'][0]['bpfmaxinsns'];
+ /* set the snort performance model */
+ if($config['installedpackages']['snort']['config'][0]['performance'])
+ $snort_performance = $config['installedpackages']['snort']['config'][0]['performance'];
+ else
+ $snort_performance = "lowmem";
+
conf_mount_rw();
/* create a few directories and ensure the sample files are in place */
exec("/bin/mkdir -p /usr/local/etc/snort");
@@ -109,7 +115,7 @@ function sync_package_snort() {
/* write out rc.d start/stop file */
write_rcfile(array(
"file" => "snort.sh",
- "start" => "BEFORE_MEM=`top | grep Free | grep Wired | awk '{print \$10}'`\n{$start}\nsleep 17\nAFTER_MEM=`top | grep Free | grep Wired | awk '{print $10}'`\necho \"Ram usage BEFORE starting Snort: \${BEFORE_MEM} -- Ram usage AFTER starting Snort: \${AFTER_MEM}\"| logger -p daemon.info -i -t SnortStartup",
+ "start" => "BEFORE_MEM=`top | grep Free | grep Wired | awk '{print \$10}'`\n{$start}\nsleep 17\nAFTER_MEM=`top | grep Free | grep Wired | awk '{print $10}'`\necho \"Ram usage BEFORE starting Snort: \${BEFORE_MEM} -- Ram usage AFTER starting Snort: \${AFTER_MEM}\" -- Mode {$snort_performance} | logger -p daemon.info -i -t SnortStartup",
"stop" => "/usr/bin/killall snort; killall snort2c"
)
);