###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2015 IPFire Development Team #
+# Copyright (C) 2015-2016 IPFire Development Team #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
$SIG{TERM} = \&Shutdown;
$SIG{QUIT} = \&Shutdown;
$SIG{HUP} = \&Reload;
+ $SIG{USR1} = \&ReloadIgnoreList;
}
#
# Update logger object in mainsettings hash.
$mainsettings{Logger} = $logger;
- # Update ignore list, if one has been specified.
- if (exists($mainsettings{IgnoreFile})) {
- &Guardian::Events::GenerateIgnoreList($mainsettings{IgnoreFile});
- }
+ # Update ignore list.
+ &ReloadIgnoreList();
# Re-generate hash of monitored files.
%monitored_files = &Guardian::Base::GenerateMonitoredFiles(\%mainsettings, \%monitored_files);
&StartWorkers();
}
+#
+## ReloadIgnoreList function.
+#
+## This function will be called if the signal handler recieves a "SIGUSR1" signal,
+## or the reload-ignore-list command will be sent via the socket connection. It just
+## performs a simple check if an ignore file has been configured and calls the responsible
+## function on the events module.
+#
+sub ReloadIgnoreList () {
+ # Update ignore list, if an ignorefile has been specified.
+ if (exists($mainsettings{IgnoreFile})) {
+ # Log reload of the ignore list.
+ $logger->Log("info", "Reloading ignore list...");
+
+ # Call responsible function from the events module.
+ &Guardian::Events::GenerateIgnoreList($mainsettings{IgnoreFile});
+ }
+}
+
#
## Shutdown function.
#