Project

General

Profile

Actions

Bug #1982

closed

Snort exits on rules update and does not restart

Added by Seb A almost 14 years ago. Updated about 13 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Snort
Target version:
-
Start date:
10/28/2011
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
2.0
Affected Plus Version:
Affected Architecture:
All

Description

Using Snort 2.9.0.5 pkg v. 2.0 on pfSense 2.0... using either autoupdate of rules or manual update of rules, if Snort is already running, the result is Snort stops. This issue is affecting a lot of people, see http://forum.pfsense.org/index.php/topic,41533.30.html. The only work-around I know of is to disable automatic update of rules, which is highly undesirable. For reference, I am currently using the Snort rules and the Emerging Threats rules.

A very edited log of the rules update:

The start:

Oct 21 12:04:52 pfSense2 SnortStartup1831: Snort Startup files Sync...
Oct 21 12:04:53 pfSense2 SnortStartup4228: Snort already running, soft restart
Oct 21 12:04:53 pfSense2 SnortStartup4345: Snort Soft Reload For 39540_em4...
Oct 21 12:04:53 pfSense2 snort20183:
Oct 21 12:04:53 pfSense2 snort20183:
Oct 21 12:04:53 pfSense2 snort20183: --== Reloading Snort --
Oct 21 12:04:53 pfSense2 snort[20183]: -- Reloading Snort ==--

<edit>
And the end:

Oct 21 12:04:56 pfSense2 snort20183: +---------------------[filtered events]-------------------
Oct 21 12:04:56 pfSense2 snort20183: +---------------------[filtered events]-------------------
Oct 21 12:04:56 pfSense2 snort20183: | gen-id=1 sig-id=2002911 type=Threshold tracking=sr
Oct 21 12:04:56 pfSense2 snort20183: | gen-id=1 sig-id=2002911 type=Threshold tracking=sr
Oct 21 12:04:56 pfSense2 snort20183: | gen-id=1 sig-id=2001219 type=Threshold tracking=sr
Oct 21 12:04:56 pfSense2 snort20183: | gen-id=1 sig-id=2001219 type=Threshold tracking=sr
Oct 21 12:04:57 pfSense2 snort20183: Snort exiting
Oct 21 12:04:57 pfSense2 snort20183: Snort exiting

Nothing too obvious there. It just exits for no apparent reason. BUT, let's:

[root@cenrallog pfSense2]# grep Reload snort.log
Oct 28 19:16:43 pfSense2 snort57972: --== Reloading Snort ==--
Oct 28 19:16:44 pfSense2 snort57972: Snort Reload: Any change to the dynamic detection configuration requires a restart.
Oct 28 19:16:44 pfSense2 snort57972: Reload via Signal HUP does not work if you aren't root or are chroot'ed.
[root@cenrallog pfSense2]#
[root@cenrallog pfSense2]# grep Reload messages.log
Oct 28 19:16:43 pfSense2 SnortStartup55009: Snort Soft Reload For 39540_em4...

OK, so it seems we are doing a soft reload, that looks like a HUP, and we may have a warning about that. Let's look in a little more detail:

[root@cenrallog pfSense2]# grep -C 5 "Reload via Signal HUP" snort.log
Oct 28 19:16:43 pfSense2 snort57972:
Oct 28 19:16:43 pfSense2 snort57972: Detection:
Oct 28 19:16:43 pfSense2 snort57972: Search-Method = AC-BNFA-Q
Oct 28 19:16:44 pfSense2 snort57972: Found pid path directive (/var/log/snort/run)
Oct 28 19:16:44 pfSense2 snort57972: Snort Reload: Any change to the dynamic detection configuration requires a restart.
Oct 28 19:16:44 pfSense2 snort57972: Reload via Signal HUP does not work if you aren't root or are chroot'ed.
Oct 28 19:16:45 pfSense2 snort57972: ===============================================================================
Oct 28 19:16:45 pfSense2 snort57972: Packet I/O Totals:
Oct 28 19:16:45 pfSense2 snort57972: Received: 2872854
Oct 28 19:16:45 pfSense2 snort57972: Analyzed: 2872848 (100.000%)
Oct 28 19:16:45 pfSense2 snort57972: Dropped: 0 ( 0.000%)

I have tested:
kill -HUP <snort pid>
logged in as root from an ssh shell, and that works fine (although there were no rule changes when I tried it), so maybe the HUP is not coming from root, or it's chroot'ed?

FYI, my HUP resulted in this, combined with a:
grep Reload snort.log
on my central log server. snort.log is just the snort process separated from the rest of the syslog messages.
Oct 28 19:26:29 pfSense2 snort4097: Reload thread starting...
Oct 28 19:26:29 pfSense2 snort4097: Reload thread started, thread 0x425e1d80 (4097)
Oct 28 19:27:23 pfSense2 snort4097: --== Reloading Snort --
Oct 28 19:28:18 pfSense2 snort[4097]: -- Reload Complete ==--

So this is presumably what SHOULD happen if one does a snort rules update with snort already running.

Actions

Also available in: Atom PDF