Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    TinyDNS service not able to start in v2.2.3-RELEASE

    Scheduled Pinned Locked Moved pfSense Packages
    30 Posts 4 Posters 4.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      doktornotor Banned
      last edited by

      @Itwerx:

      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…

      1 Reply Last reply Reply Quote 0
      • I
        Itwerx
        last edited by

        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!

        1 Reply Last reply Reply Quote 0
        • D
          doktornotor Banned
          last edited by

          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>

          1 Reply Last reply Reply Quote 0
          • E
            ecce
            last edited by

            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

            ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
                                          murphy's rule: "there is always one error left."
            ~~(¸¸ ¸¸ºº> ___________________________________________________.·'´¯)~
            ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              @ecce:

              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
              
              
              1 Reply Last reply Reply Quote 0
              • I
                Itwerx
                last edited by

                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)…?

                1 Reply Last reply Reply Quote 0
                • D
                  doktornotor Banned
                  last edited by

                  PR merged, no longer needed to mess with anything manually.

                  1 Reply Last reply Reply Quote 0
                  • I
                    Itwerx
                    last edited by

                    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

                    1 Reply Last reply Reply Quote 0
                    • E
                      ecce
                      last edited by

                      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

                      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
                                                    murphy's rule: "there is always one error left."
                      ~~(¸¸ ¸¸ºº> ___________________________________________________.·'´¯)~
                      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

                      1 Reply Last reply Reply Quote 0
                      • D
                        doktornotor Banned
                        last edited by

                        Thanks for testing. ;)

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.