From f031bf5879fb924ce7ff09f358a00731d46357df Mon Sep 17 00:00:00 2001 From: Benoit GUERIN Date: Sun, 5 Aug 2012 17:46:09 +0200 Subject: Deleting dead code --- config/tinydns/tinydns.inc | 21 --------------------- config/tinydns/tinydns.xml | 40 ---------------------------------------- 2 files changed, 61 deletions(-) (limited to 'config/tinydns') diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 1b3e7c0c..959a9719 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -59,27 +59,6 @@ function tinydns_custom_php_install_command() { $ipaddress = $config['installedpackages']['tinydns']['config'][0]['ipaddress']; - $minsegment = "10240"; - $maxfilesize = "10240"; - $maxsegment = "20480"; - $maxfd = "100"; - $maxchild = "40"; - - if($config['installedpackages']['tinydns']['config'][0]['minsegment']) - $minsegment = $config['installedpackages']['tinydns']['config'][0]['minsegment']; - - if($config['installedpackages']['tinydns']['config'][0]['maxfilesize']) - $maxfilesize = $config['installedpackages']['tinydns']['config'][0]['maxfilesize']; - - if($config['installedpackages']['tinydns']['config'][0]['maxsegment']) - $maxsegment = $config['installedpackages']['tinydns']['config'][0]['maxsegment']; - - if($config['installedpackages']['tinydns']['config'][0]['maxfd']) - $maxfd = $config['installedpackages']['tinydns']['config'][0]['maxfd']; - - if($config['installedpackages']['tinydns']['config'][0]['maxchild']) - $maxchild = $config['installedpackages']['tinydns']['config'][0]['maxchild']; - if($config['installedpackages']['tinydns']['config'][0]['refreshinterval']) $refreshinterval = $config['installedpackages']['tinydns']['config'][0]['refreshinterval']; diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml index fba16905..b90a2cb3 100644 --- a/config/tinydns/tinydns.xml +++ b/config/tinydns/tinydns.xml @@ -249,46 +249,6 @@ - - listtopic - Advanced tunables (OPTIONAL) - temp - - - Minimum segment size - minsegment - Recommended size: 10240 or larger. - input - 10240 - - - Maximum file size - maxfilesize - Recommended size: 10240 or larger. - input - 10240 - - - Max Segment size - maxsegment - Recommended size: 20480 or larger. - input - 20480 - - - Maximum file descriptors - maxfd - Recommended size: 100 or larger. - input - 100 - - - Maximum children processes - maxchild - Recommended size: 40 or larger. - input - 40 - tinydns_custom_php_changeip_command(); -- cgit v1.2.3 From bd190c0d57fa5ea228dfacbceccf4d9249ee8c69 Mon Sep 17 00:00:00 2001 From: Benoit GUERIN Date: Wed, 29 Aug 2012 07:57:34 +0200 Subject: Using multilog instead of readproctitle to log svscan output --- config/tinydns/tinydns.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/tinydns') diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 959a9719..7c8f15d7 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -76,6 +76,7 @@ rcvar=`set_rcvar` command="/usr/local/bin/svscan" svscan_enable=\${svscan_enable-"YES"} svscan_servicedir=\${svscan_servicedir-"{$g['varrun_path']}/service"} +logdir="/var/log/svscan" start_cmd="svscan_start" stop_postcmd="svscan_stop_post" @@ -86,9 +87,10 @@ required_dirs="\${svscan_servicedir}" svscan_start () { echo "Starting svscan." + mkdir -p \$logdir /usr/bin/env \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ - /usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................ &" > /dev/null + /usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/multilog t \$logdir" > /dev/null minicron {$refreshinterval} {$g['varrun_path']}/ping_hosts.pid "/etc/ping_hosts.sh; cd {$g['varetc_path']}/tinydns/root && /usr/local/bin/tinydns-data" } -- cgit v1.2.3 From 9ef793166596542a282d00b8c2a45acd1e53a7e0 Mon Sep 17 00:00:00 2001 From: Benoit GUERIN Date: Wed, 29 Aug 2012 08:24:59 +0200 Subject: Adding option to disable IP monitoring --- config/tinydns/tinydns.inc | 28 +++++++++++++++++++++------- config/tinydns/tinydns.xml | 14 ++++++++++---- 2 files changed, 31 insertions(+), 11 deletions(-) (limited to 'config/tinydns') diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 7c8f15d7..70e149e1 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -53,12 +53,13 @@ function tinydns_custom_php_install_command() { log_error("Could not open /usr/local/etc/rc.d/svscan.sh for writing."); return; } - + // Ensure svscan.sh has a+rx exec("chmod a+rx /usr/local/etc/rc.d/svscan.sh"); - + $ipaddress = $config['installedpackages']['tinydns']['config'][0]['ipaddress']; + $enableipmonitoring = $config['installedpackages']['tinydns']['config'][0]['enableipmonitoring']; if($config['installedpackages']['tinydns']['config'][0]['refreshinterval']) $refreshinterval = $config['installedpackages']['tinydns']['config'][0]['refreshinterval']; @@ -91,7 +92,14 @@ svscan_start () { /usr/bin/env \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ /usr/sbin/daemon -f /bin/sh -c "\$command \$svscan_servicedir 2>&1 | /usr/local/bin/multilog t \$logdir" > /dev/null +EOD; +if ($enableipmonitoring) { + $svscan .= << + tinydns_create_zone_file();\n"; + if ($enableipmonitoring) { + $start .= "tinydns_setup_ping_items();\n"; + } + $start .= "?> ENDPHP\n"; $stop = ""; @@ -617,7 +627,9 @@ function tinydns_sync_on_changes() { tinydns_do_xmlrpc_sync($sync_to_ip, $password); } tinydns_create_zone_file(); - tinydns_setup_ping_items(); + if ($config['installedpackages']['tinydns']['config'][0]['enableipmonitoring']) { + tinydns_setup_ping_items(); + } log_error("[tinydns] tinydns_xmlrpc_sync.php is ending."); } @@ -685,7 +697,9 @@ function tinydns_do_xmlrpc_sync($sync_to_ip, $password) { $execcmd = "require_once('/usr/local/pkg/tinydns.inc');\n"; $execcmd .= "tinydns_custom_php_changeip_command();\n"; $execcmd .= "tinydns_create_zone_file();\n"; - $execcmd .= "tinydns_setup_ping_items();\n"; + if ($config['installedpackages']['tinydns']['config'][0]['enableipmonitoring']) { + $execcmd .= "tinydns_setup_ping_items();\n"; + } /* assemble xmlrpc payload */ $params = array( diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml index b90a2cb3..546980f1 100644 --- a/config/tinydns/tinydns.xml +++ b/config/tinydns/tinydns.xml @@ -194,7 +194,7 @@ regdhcpstatic Register static DHCP leases with TinyDNS server using the Fully Qualified Domain Name specified in System: General. checkbox - + Register DHCP leases with server regdhcp @@ -203,8 +203,14 @@ listtopic - Monitoring IP refresh interval - temp + IP Monitoring + temp + + + Enable IP monitoring + enableipmonitoring + Wheather or not to monitor IP address + checkbox Refresh Interval @@ -215,7 +221,7 @@ listtopic Sync TinyDNS settings via XMLRPC - temp + temp XMLRPC Sync -- cgit v1.2.3