From 8bcb5fb1e8a0718f88f99cde2f5b5a3bae5c4451 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 2 Mar 2015 09:41:14 +0100 Subject: Implement latency tracking, internal event log and watchdog --- sysdep/unix/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sysdep/unix/main.c') 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); } -- cgit v1.2.3