+++ /dev/null
-libipulog:
-X handle multi-part nlmsgs
-- Error checking at netlink socket
-- forward port my timeout enabled read-function from libipq to libipulog
-- man pages
-
-kernel:
-X queue the logging in the kernel and send multiple packets in one
- multipart nlmsg
-X add timer to flush queue in user-defineable time intervals
-- IPv6 ULOG target
-
-ulogd:
-X MYSQL output plugin
-X syslog compatibility output plugin
-- autoconf-detection of ipt_ULOG.h
-X _fini() support for plugin destructors (needed for clean shutdown and
- SIGHUP configfile reload
-X commandline option for "to fork or not to fork"
-X various command line options (we don't even have --version)
-- add support for capabilities to run as non-root
-X big endian fixes
-X man pages
-- IPv6 support (core and extensions)
-X pcap output plugin (to use ethereal/tcpdump/... for the logs)
-- enable user to specify directory where to look for kernel include files
-- support for static linking
-- make core maintain a list of keyid's that all the output plugins are
- interested. The interpreters would be called with their respective
- section of that list, and only compute those values that are actually
- used by any of the running output plugins
-- issues with ulogd_BASE and partially copied packets (--ulog-cprange)
-- problem wrt. ulogd_BASE and fragments
-- implement extension SIGHUP handlers (including config re-parse)
-
-conffile:
-- rewrite parser. This stuff is a real mess. Anybody interested?
sigaddset(&sigs, SIGHUP);
sigaddset(&sigs, SIGUSR1);
sigaddset(&sigs, SIGUSR2);
+ sigaddset(&sigs, SIGRTMAX);
pthread_sigmask(SIG_BLOCK, &sigs, NULL);
while (1) {
sigemptyset(&sigs);
- sigaddset(&sigs, SIGHUP);
+ //sigaddset(&sigs, SIGHUP);
sigaddset(&sigs, SIGUSR1);
sigaddset(&sigs, SIGUSR2);
+ sigaddset(&sigs, SIGRTMAX);
err = sigwait(&sigs, &sig);
if (err) {
printlog(LOG_CRITICAL, "sigwait() returned an error.\n");
flushlog();
+ continue;
+ }
+
+ if (sig == SIGRTMAX) {
+ printf("Caught SIGRTMAX - toggling fake partitions.\n");
+ do_partition = !do_partition;
+ continue;
}
switch (sig) {
case SIGHUP:
- printlog(LOG_WARN, "Caught SIGHUP - re-reading XML file.\n");
- reconfig();
- //time_reconfig(1000); /* instrumentation */
- flushlog();
+ printlog(LOG_CRITICAL, "Caught SIGHUP in signal_thread_func?!?\n");
+ printf("Caught SIGHUP in signal_thread_func?!?\n");
break;
case SIGUSR1:
pthread_rwlock_wrlock(&limiter.limiter_lock);
pthread_rwlock_unlock(&limiter.limiter_lock);
break;
case SIGUSR2:
- do_partition = !do_partition;
+ printlog(LOG_WARN, "Caught SIGUSR2 - re-reading XML file.\n");
+ printf("Caught SIGUSR2 - re-reading XML file.\n");
+ reconfig();
+ flushlog();
break;
default:
/* Intentionally blank. */
sigset_t signal_mask;
sigemptyset(&signal_mask);
- sigaddset(&signal_mask, SIGHUP);
+ //sigaddset(&signal_mask, SIGHUP);
sigaddset(&signal_mask, SIGUSR1);
sigaddset(&signal_mask, SIGUSR2);
+ sigaddset(&signal_mask, SIGRTMAX);
pthread_sigmask(SIG_BLOCK, &signal_mask, NULL);
if (pthread_create(&signal_thread, NULL, &signal_thread_func, NULL) != 0) {
return 0;
}
+static void drl_signal(int sig) {
+ if (sig == SIGHUP) {
+ printf("Caught SIGHUP - reopening DRL log file.\n");
+
+ fclose(logfile);
+ logfile = fopen(drl_logfile.u.string, "a");
+ printlog(LOG_CRITICAL, "Reopened logfile.\n");
+ } else {
+ printlog(LOG_WARN, "Caught unexpected signal %d in drl_signal.\n", sig);
+ }
+}
+
static ulog_output_t drl_op = {
.name = "drl",
.output = &_output_drl,
- .signal = NULL, /* This appears to be broken. Using my own handler. */
+ .signal = &drl_signal,
.init = &drl_plugin_init,
.fini = NULL,
};