Hi.
I did some investigations on the root cause of Snort failing e.g. for PPPoE connections with a provider-side forced DHCP renew.
The problem is that /etc/rc.start_packages (invoked indirectly by /etc/rc.newwanip) does refresh the Snort configuration file (/usr/pbi/snort-<platform>/etc/snort/snort_<…>/snort.conf), however, Snort does not read it immediately as it does in case of modifications via the GUI).
In order to reload the configuration, we need to send SIGHUP to the running Snort instance (the Snort executable that comes with pfSense is capable of reloading without restarting, see also /usr/local/pkg/snort/snort.inc (function snort_reload_config)).
A workaround without changing the PHP files would be to introduce an additional shell script placed in /usr/local/etc/rc.d.
snort_pids="$(pgrep snort | xargs)"
if [ ! -z $snort_pids ]; then
/usr/bin/logger -p daemon.info -i -t SnortReload "Snort RELOAD for all interfaces... (${snort_pids})"
kill -HUP $snort_pids
fi
barnyard2_pids="$(pgrep barnyard2 | xargs)"
if [ ! -z $barnyard2_pids ]; then
/usr/bin/logger -p daemon.info -i -t SnortReload "Barnyard2 RELOAD for all interfaces... (${barnyard2_pids})"
kill -HUP $barnyard2_pids
fi
This script reloads all running Snort an Barnyard instances. Note: this is not the optimal solution if running Snort for multiple interfaces, but only one configuration changed.
Tested on pfSense 2.2.4-RELEASE (amd64), Snort 3.2.8.</platform>