From 6e38a4cd55e8a8b51b578213e571c1eaff3fd745 Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Thu, 2 Dec 2010 21:34:42 +0200 Subject: Added configurable Statistics settings. Remove touch() of unbound log file at install time - this is all handled by syslog now. --- config/unbound/unbound.inc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'config/unbound/unbound.inc') diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index 387212dc..873b012d 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -49,11 +49,11 @@ function unbound_initial_setup() { // Touch needed files @touch("/usr/local/etc/unbound/root.hints"); @touch("/usr/local/etc/unbound/root-trust-anchor"); + @touch("{$g['varlog_path']}/unbound.log"); // Ensure files and folders belong to unbound @chown("/usr/local/etc/unbound/root-trust-anchor", "unbound"); @chgrp("/usr/local/etc/unbound/root-trust-anchor", "wheel"); @chmod("/usr/local/etc/unbound/root-trust-anchor", 0600); - @chown("{$g['varlog_path']}/unbound.log", "unbound"); // We do not need the sample conf or the default rc.d startup file @unlink_if_exists("/usr/local/etc/unbound/unbound.conf.sample"); @unlink_if_exists("/usr/local/etc/rc.d/unbound"); @@ -281,6 +281,20 @@ function unbound_resync_config() { // Domain Overrides $domain_overrides = unbound_add_domain_overrides(); + // Unbound Statistics + if($unbound_config['stats'] == "on") { + $stats_interval = $unbound_config['stats_interval']; + $cumulative_stats = $unbound_config['cumulative_stats']; + if ($unbound_config['extended_stats'] == "on") + $extended_stats = "yes"; + else + $extended_stats = "no"; + } else { + $stats_interval = "0"; + $cumulative_stats = "no"; + $extended_stats = "no"; + } + $unbound_conf = << +?> \ No newline at end of file -- cgit v1.2.3