TinyDNS service not able to start in v2.2.3-RELEASE
-
https://github.com/pfsense/pfsense-packages/pull/909
Did you have a chance to give it any review or was the github just to get it in there for further development…?
It's been "sitting" there for 2 days. Give it some time to get reviewed and merged…
-
It's been "sitting" there for 2 days. Give it some time to get reviewed and merged…
Yes, of course, wasn't impugning the process. Just figured if it had been given further review and was considered a valid patch, (not still missing paths or whatever), then I would go ahead and test it out and report back my results. (Conversely if it's known to be incomplete than I'd wait.) - Thanks!
-
I don't plan on changing anything there unless required. If you want to test it, probably the best way is to paste relevant parts into http(s)://<pfs_ip_or_fqdn>/exec.php
$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 = <<<eod<br>#!/bin/sh # PROVIDE: svscan # REQUIRE: LOGIN # KEYWORD: FreeBSD . /etc/rc.subr name="svscan" rcvar="\${name}_enable" command="{$svscan_path}" 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" load_rc_config \$name required_dirs="\${svscan_servicedir}" svscan_start () { echo "Starting svscan." mkdir -p \$logdir /usr/bin/env \ PATH={$tinydns_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 .= <<<eod<br>/usr/local/bin/minicron {$refreshinterval} {$g['varrun_path']}/ping_hosts.pid "/usr/local/bin/ping_hosts.sh" EOD; } $svscan .= <<<eod<br>} svscan_stop_post () { echo "Stopping svscan." find -L "\$svscan_servicedir" -mindepth 1 -maxdepth 2 -type d \( \! -path "\$svscan_servicedir/*/*" -or -name 'log' \) -print0 | xargs -0 {$svc_path} -dx /bin/pkill -F /var/run/ping_hosts.pid } run_rc_command "\$1" EOD; fwrite($fd, $svscan); fclose($fd);</eod<br></eod<br></eod<br>
After that, make a backup and replace /usr/local/pkg/tinydns.inc with the fixed one.</pfs_ip_or_fqdn>
-
Thank you, Doktor!
For sending a patch in the right direction, and for posting a How-To how we can try it.
Worked out with minor additions in your above posted code:
- an additional line break here:
/usr/local/bin/minicron {$refreshinterval} {$g['varrun_path']}/ping_hosts.pid "/usr/local/bin/ping_hosts.sh" EOD; } $svscan .= <<<eod<br>--->>>line break here<<<--- } svscan_stop_post () {</eod<br>
- an additional line before fwrite (had to instant-teach myself a little bit php for this :)):
$fd=fopen("/usr/local/etc/rc.d/svscan.sh","w");
- and after that edit /usr/local/etc/rc.d/svscan.sh and remove all ^M chars at the end of the line. (yes, I know…windoze)
Again, thanks!
Marc -
and after that edit /usr/local/etc/rc.d/svscan.sh and remove all ^M chars at the end of the line. (yes, I know…windoze)
sed -i "s/.$//g" /some/file
-
Am I correct in assuming this snippet of code is sufficiently self-contained that it can go pretty much anywhere in exec.php, (not literally of course, being careful not to break existing syntax)…?
-
PR merged, no longer needed to mess with anything manually.
-
Thanks Doc, that was fast!
I did a reinstall on the package, and while I don't see any of the new svscan stuff in the exec.php I am happy to report that it seems to be running properly now. Woohoo! Much rockage! :P
-
Yes, can confirm that - installed it on a system which didn't have anything to do with tinydns before, configured basic settings, started svscan and that was it!
Yay!
;D -
Thanks for testing. ;)