summaryrefslogtreecommitdiff
path: root/sysdep/unix/main.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-03-02 09:41:14 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2015-03-02 09:41:14 +0100
commit8bcb5fb1e8a0718f88f99cde2f5b5a3bae5c4451 (patch)
treec4ce5adbef88e2b2b002d42e274773f424aa1f19 /sysdep/unix/main.c
parent4e63974471c4e2f11781cda163e0dc2ac6fb72f9 (diff)
Implement latency tracking, internal event log and watchdog
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r--sysdep/unix/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 61b306dc..05f7560d 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -168,6 +168,9 @@ sysdep_preconfig(struct config *c)
{
init_list(&c->logfiles);
+ c->latency_limit = UNIX_DEFAULT_LATENCY_LIMIT;
+ c->watchdog_warning = UNIX_DEFAULT_WATCHDOG_WARNING;
+
#ifdef PATH_IPROUTE_DIR
read_iproute_table(PATH_IPROUTE_DIR "/rt_protos", "ipp_", 256);
read_iproute_table(PATH_IPROUTE_DIR "/rt_realms", "ipr_", 256);
@@ -585,6 +588,8 @@ handle_sigterm(int sig UNUSED)
async_shutdown_flag = 1;
}
+void watchdog_sigalrm(int sig UNUSED);
+
static void
signal_init(void)
{
@@ -600,6 +605,9 @@ signal_init(void)
sa.sa_handler = handle_sigterm;
sa.sa_flags = SA_RESTART;
sigaction(SIGTERM, &sa, NULL);
+ sa.sa_handler = watchdog_sigalrm;
+ sa.sa_flags = 0;
+ sigaction(SIGALRM, &sa, NULL);
signal(SIGPIPE, SIG_IGN);
}