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

Dnsmasq error reading /var/db/dhcpd.leases

Scheduled Pinned Locked Moved DHCP and DNS
7 Posts 2 Posters 5.1k 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.
  • S
    Superman
    last edited by Feb 25, 2006, 3:26 AM

    On recent snapshots I've been getting this error (02-19,02-20)

    dnsmasq[46274]: failed to access /var/db/dhcpd.leases: No such file or directory

    and on the more recent 02-22 I get:

    dnsmasq[46274]: failed to access /var/dhcpd/dhcpd.leases: No such file or directory

    I think I found the problem on line 563 of /etc/inc/services.inc

    it reads in 02-19:

    $args .= " -l {$g['vardb_path']}/dhcpd.leases" .

    and in 02-22 it reads:

    $args .= " -l {$g['dhcpd_chroot_path']}/dhcpd.leases" .

    I changed it to:

    $args .= " -l {$g['dhcpd_chroot_path']}/var/db/dhcpd.leases" .

    on my system and it seems to work!

    1 Reply Last reply Reply Quote 0
    • S
      sullrich
      last edited by Feb 25, 2006, 6:57 AM

      This was fixed recently.  Check cvstrac.

      1 Reply Last reply Reply Quote 0
      • S
        Superman
        last edited by Feb 25, 2006, 8:06 AM

        Okay, thanks!

        In cvstrac the most recent releng_1 service.inc I find is 1.72.2.24 which reads $args .= " -l {$g['dhcpd_chroot_path']}/dhcpd.leases" . on line 563

        but of course my experience is limited and I probably don't know the right place to look, or I'm even looking at the wrong file…can you point me to the right place?

        1 Reply Last reply Reply Quote 0
        • S
          sullrich
          last edited by Feb 25, 2006, 8:50 AM

          That is correct.

          1 Reply Last reply Reply Quote 0
          • S
            Superman
            last edited by Feb 25, 2006, 7:48 PM

            Okay, thanks!

            Maybe my system is messed up or something, but with services.inc version 1.72.2.24, and with DNS Forwarder running, I get the error in the system logs

            dnsmasq[<pid>]: failed to access /var/dhcpd/dhcpd.leases: No such file or directory

            here's the results of searching for dhcpd.leases, etc:

            # ls -l /var/dhcpd/
            total 539
            dr-xr-xr-x  4 dhcpd  _dhcp     512 Feb 22 23:14 dev
            -rwxr-xr-x  1 dhcpd  _dhcp  521718 Feb 15 18:02 dhcpd
            drwxr-xr-x  2 dhcpd  _dhcp     512 Feb 11 09:03 etc
            drwxr-xr-x  2 dhcpd  _dhcp     512 Feb 11 09:03 lib
            drwxr-xr-x  2 dhcpd  _dhcp     512 Feb 11 09:03 run
            drwxr-xr-x  3 dhcpd  _dhcp     512 Feb 11 09:03 usr
            drwxr-xr-x  4 dhcpd  _dhcp     512 Feb 11 09:03 var
            # find / -iname dhcpd.leases
            /var/dhcpd/var/db/dhcpd.leases
            # cat /etc/inc/globals.inc | grep dhcpd_chroot_path
                "dhcpd_chroot_path" => "/var/dhcpd",
            # cat /etc/inc/services.inc | grep dhcpd_chroot_path
                    $status = `mount | grep "{$g['dhcpd_chroot_path']}/dev"`;
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/dev\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/etc\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr/local/sbin\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/var/db\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/usr\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/lib\n");
                    fwrite($fd, "mkdir -p {$g['dhcpd_chroot_path']}/run\n");
                    fwrite($fd, "chown -R dhcpd:_dhcp {$g['dhcpd_chroot_path']}/*\n");
                    fwrite($fd, "cp /lib/libc.so.6 {$g['dhcpd_chroot_path']}/lib/\n");
                    fwrite($fd, "cp /usr/local/sbin/dhcpd {$g['dhcpd_chroot_path']}/usr/local/sbin/\n");
                    fwrite($fd, "chmod a+rx {$g['dhcpd_chroot_path']}/usr/local/sbin/dhcpd\n");
                            fwrite($fd, "mount_devfs devfs {$g['dhcpd_chroot_path']}/dev\n");
                    $fd = fopen("{$g['dhcpd_chroot_path']}/etc/dhcpd.conf", "w");
                    touch("{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases");
                    mwexec("/usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot {$g['dhcpd_chroot_path']} -cf {$g['dhcpd_chroot_path']}/etc/dhcpd.conf " .
                                    $args .= " -l {$g['dhcpd_chroot_path']}/dhcpd.leases" .
            

            Am I missing something or is my dhcpd.leases being written to the wrong place? It seems to me that the last line there (from the dnsmasq section) is looking for the dhcpd.leases file in /var/dhcpd/dhcpd.leases, but dhcpd is writing the file to /var/dhcpd/var/db/dhcpd.leases…

            TIA</pid>

            1 Reply Last reply Reply Quote 0
            • S
              sullrich
              last edited by Feb 25, 2006, 7:55 PM

              Yep, its missing a /var/db/, I overlooked that.  Will fix shortly.

              1 Reply Last reply Reply Quote 0
              • S
                Superman
                last edited by Feb 25, 2006, 7:57 PM

                Cool, thanks!!

                I actually added that into mine, and that made it work a-ok!!  8)

                1 Reply Last reply Reply Quote 0
                7 out of 7
                • First post
                  7/7
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                  This community forum collects and processes your personal information.
                  consent.not_received