From e41a72c628f0baf65a9f581a3536986b59c8a3fb Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 28 Jul 2015 16:01:58 +0200 Subject: Bug #4555 - Tiny DNS: Service does not start Attempt on fixing the paths. --- config/tinydns/tinydns.inc | 47 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/config/tinydns/tinydns.inc b/config/tinydns/tinydns.inc index 5effa10c..f2bda436 100644 --- a/config/tinydns/tinydns.inc +++ b/config/tinydns/tinydns.inc @@ -63,6 +63,21 @@ function tinydns_custom_php_install_command() { if($config['installedpackages']['tinydns']['config'][0]['refreshinterval']) $refreshinterval = $config['installedpackages']['tinydns']['config'][0]['refreshinterval']; + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version == "2.2") { + $svscan_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svscan"; + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svc"; + $tinydns_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin"; + } else if ($pf_version == "2.1") { + $svscan_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svscan"; + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svc"; + $tinydns_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin"; + } else { + $svscan_path = "/usr/local/bin/svscan"; + $svc_path = "/usr/local/bin/svc"; + $tinydns_path = "/usr/local/bin"; + } + $svscan = <<&1 | /usr/local/bin/multilog t \$logdir" > /dev/null EOD; @@ -105,7 +120,7 @@ $svscan .= << $dnsif) - $stop .= "\t/usr/local/bin/svc -dx {$g['varrun_path']}/service/dnscache{$dnsidx}\n"; + $stop .= "\t{$svc_path} -dx {$g['varrun_path']}/service/dnscache{$dnsidx}\n"; $stop .= <</dev/null /bin/rm -rf {$g['varetc_path']}/tinydns 2>/dev/null /bin/rm -rf {$g['varrun_path']}/dnscache* 2>/dev/null @@ -161,9 +176,19 @@ function tinydns_custom_php_deinstall_command() { global $g, $config; conf_mount_rw(); + + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version == "2.2") { + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/local/bin/svc"; + } else if ($pf_version == "2.1") { + $svc_path = "/usr/pbi/djbdns-" . php_uname("m") . "/bin/svc"; + } else { + $svc_path = "/usr/local/bin/svc"; + } + /* destroy all daemontools items */ - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/tinydns*"); - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache*"); + exec("{$svc_path} -xk {$g['varetc_path']}/tinydns*"); + exec("{$svc_path} -xk {$g['varetc_path']}/dnscache*"); exec("/usr/local/etc/rc.d/tinydns.sh stop"); exec("/usr/local/etc/rc.d/svscan.sh stop"); exec("/usr/bin/killall supervise"); @@ -225,7 +250,7 @@ function tinydns_custom_php_changeip_command() { } exec("echo {$dnsserverip} > {$g['varetc_path']}/tinydns/env/IP"); - exec("/usr/local/bin/svc -xk {$g['varrun_path']}/service/tinydns"); + exec("{$svc_path} -xk {$g['varrun_path']}/service/tinydns"); if(!empty($config['installedpackages']['tinydns']['config'][0]['enableforwarding'])) { @@ -277,7 +302,7 @@ function tinydns_custom_php_changeip_command() { /* setup symlink to start dnscache */ exec("/bin/ln -s {$g['varetc_path']}/dnscache{$dnsidx} {$g['varrun_path']}/service/"); - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache{$dnsidx}"); + exec("{$svc_path} -xk {$g['varetc_path']}/dnscache{$dnsidx}"); } } else { $interfaces = explode(",", $$config['installedpackages']['tinydns']['config'][0]['interface']); @@ -285,7 +310,7 @@ function tinydns_custom_php_changeip_command() { if(is_dir("{$g['varetc_path']}/dnscache{$dnsidx}")) dnscache_use_root_servers($dnsidx); } - exec("/usr/local/bin/svc -xk {$g['varetc_path']}/dnscache*"); + exec("{$svc_path} -xk {$g['varetc_path']}/dnscache*"); } /* a wee bit of magic - something seems to start up a broken dnscache, the below kills it, and svc restarts it correctly. */ -- cgit v1.2.3 From 01bedc72745527d23d0b3d08b075bac8181c0a42 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 28 Jul 2015 16:13:56 +0200 Subject: Bump tinydns package version --- pkg_config.10.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index ee594cd1..07ed1be1 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -687,7 +687,7 @@ pfSense version of TinyDNS which features failover host support http://cr.yp.to/djbdns.html Services - 1.0.6.22 + 1.0.6.23 Beta https://doc.pfsense.org/index.php/Tinydns_package 2.2 -- cgit v1.2.3 From 0d4ec90484b67c29066c4d25f5bbfce8dfb2863f Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 31 Jul 2015 14:26:03 +0200 Subject: tinydns.xml - fix permissions for installed files - Removed whole lot of 077 chmods - Make the 3 scripts that actually have /usr/local/bin/php shebang 0775 instead. --- config/tinydns/tinydns.xml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml index fa80953c..3114ebb2 100644 --- a/config/tinydns/tinydns.xml +++ b/config/tinydns/tinydns.xml @@ -94,62 +94,53 @@ installedpackages->package->tinydns /usr/local/pkg/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns.inc /usr/local/pkg/pf/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_xmlrpc_sync.php /usr/local/pkg/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_domains.xml /usr/local/www/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_status.php /usr/local/www/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_dhcp_filter.php /usr/local/www/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_filter.php /usr/local/pkg/ - 077 + 0775 https://packages.pfsense.org/packages/config/tinydns/tinydns_down.php /usr/local/pkg/ - 077 + 0775 https://packages.pfsense.org/packages/config/tinydns/tinydns_up.php /usr/local/pkg/ - 077 + 0775 https://packages.pfsense.org/packages/config/tinydns/tinydns_parse_logs.php /usr/local/www/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_view_logs.php /usr/local/pkg/ - 077 https://packages.pfsense.org/packages/config/tinydns/tinydns_sync.xml /usr/local/www/wizards/ - 077 https://packages.pfsense.org/packages/config/tinydns/new_zone_wizard.xml -- cgit v1.2.3 From 5a9c7fb048f48c8b7c4db4560e326a1e3b65a97f Mon Sep 17 00:00:00 2001 From: doktornotor Date: Fri, 31 Jul 2015 21:29:24 +0200 Subject: tinydns.xml - fix copyright header, remove unused tags, fix indentation, fix PHP style. --- config/tinydns/tinydns.xml | 109 +++++++++++++++++++++++---------------------- 1 file changed, 56 insertions(+), 53 deletions(-) diff --git a/config/tinydns/tinydns.xml b/config/tinydns/tinydns.xml index 3114ebb2..55ee3269 100644 --- a/config/tinydns/tinydns.xml +++ b/config/tinydns/tinydns.xml @@ -2,45 +2,47 @@ - - + - - Describe your package here - Describe your package requirements here - Currently there are no FAQ items provided. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/* ====================================================================================== */ + ]]> + tinydns 1.0 DNS Server: Settings @@ -228,23 +230,23 @@ Hosts allowed to perform DNS Zone Transfers - Note: this requires TCP port 53 firewall permit rule! none - rowhelper - - - IP Address - ztipaddress - Enter the IP Address that is allowed to transfer zone records (ex: 4.2.2.1) - input - 20 - - - DNS Zone - Use * for all Zones - dnszone - Enter the DNS zone that this IP address is allowed to transfer (ex: domain.com) - input - 20 - - + rowhelper + + + IP Address + ztipaddress + Enter the IP Address that is allowed to transfer zone records (ex: 4.2.2.1) + input + 20 + + + DNS Zone - Use * for all Zones + dnszone + Enter the DNS zone that this IP address is allowed to transfer (ex: domain.com) + input + 20 + + @@ -281,9 +283,10 @@ start svscan to bring up the DNS Server"; + unset($_POST['temp']); + if (!is_process_running("svscan")) { + $savemsg = "NOTE: svscan is not running. Please start svscan to bring up the DNS Server"; + } ]]> -- cgit v1.2.3