Dhcpleases6 Bug (was DHCPv6 server Bug (Massive dhcpd6.leases file))
-
I am a bit of a newbie here. Any help appreciated.
I am running 2.1-BETA1 (amd64) built on Mon Apr 22 07:12:26 EDT 2013 FreeBSD 8.3-RELEASE-p7. I have a he.net ipv6 tunnel setup and working well.
Whenever I turn on the dhcpd6 server, it starts creating a giant dhcpd6.leases file. It repeats the same ipv6 assignment many many times. Here are the files with just two ipv6 assignments moments after turning on the dhpcd6 server.
total 8344
drwxr-xr-x 2 dhcpd _dhcp 512 Apr 22 17:27 .
drwxr-xr-x 4 dhcpd _dhcp 512 Apr 15 06:08 ..
-rw-r–r-- 1 root _dhcp 186 Apr 22 17:27 dhcpd.leases
-rw-r--r-- 1 dhcpd _dhcp 186 Apr 22 17:26 dhcpd.leases~
-rw-r--r-- 1 root _dhcp 8507470 Apr 22 17:34 dhcpd6.leases
-rw-r--r-- 1 root _dhcp 0 Apr 22 17:27 dhcpd6.leases~After a while, the dhcpd6.leases file gets so big and I get GUI php error about php running out of memory.
Any suggestions on debugging this are much appreciated.
EDIT:
When I kill the dhcpleases6 process, this problem goes away. FYI, the process shows up as follows:
/usr/local/sbin/dhcpleases6 -c /usr/local/bin/php -f /usr/local/sbin/prefixes.php|/bin/sh -l /var/dhcpd/var/db/dhcpd6.leases
Again, I am a newbie (and perhaps too daring), but I tried to run this from the console and got this:
dhcpleases6: illegal option -- f
Wrong number of arguments given.: No error: 0
Illegal option -lEDIT2:
FYI: In dnsmasq settings in the GUI, when I disable "DHCP Registration", "Static DHCP", and "Prefer DHCP"; dhcpleases6 still runs, but dhcpleases does not.Also, dhcpd -6 and dhcpleases6 seem to be interacting to cause the massive dhcpd6.leases file, based on the following:
[2.1-BETA1][admin@pfsense.[redacted]]/root(90): ps aux | grep dhc
dhcpd 25461 0.7 0.1 15180 9576 ?? Ss 7:43AM 0:00.72 /usr/local/sbin/dhcpd -6 -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpdv6.conf -pf /var/run/dhcpdv6.pid em1
root 19554 0.0 0.0 5780 1356 ?? Is 7:42AM 0:00.00 /usr/local/sbin/dhcpleases -l /var/dhcpd/var/db/dhcpd.leases -d [redacted] -p /var/run/dnsmasq.pid -h /var/etc/hosts
dhcpd 24511 0.0 0.1 13004 8532 ?? Ss 7:43AM 0:00.00 /usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid em1
root 25884 0.0 0.0 2724 1108 ?? Ss 7:43AM 0:00.03 /usr/local/sbin/dhcpleases6 -c /usr/local/bin/php -f /usr/local/sbin/prefixes.php|/bin/sh -l /var/dhcpd/var/db/dhcpd6.leases
root 87130 0.0 0.0 14796 2808 ?? Ss 6:49AM 0:09.83 /usr/sbin/syslogd -s -c -c -l /var/dhcpd/var/run/log -f /var/etc/syslog.conf
root 11789 0.0 0.0 9068 1404 0 RL+ 7:44AM 0:00.00 grep dhcAny suggestions?
-
I'm not seeing that on my setup with dhcpleases6…
It looks like, if you want to run the command manually, you'd run:
/usr/local/sbin/dhcpleases6 -c "/usr/local/bin/php -f /usr/local/sbin/prefixes.php|/bin/sh" -l /var/dhcpd/var/db/dhcpd6.leases
We may need to see the contents of that leases file.
-
Thank you for looking at this. I have tried a lot of different things to solve this and am able to repeat it fairly easily. Hopefully I am helping to squash a bug (rather than doing something silly [blush]).
I will PM you a link to the dhcp6.leases file.
I tried killing dhcpleases6 and restarting with the command you provided. dhcpleases6 did restart, but the dhcpd6.leases file kept growing (i.e. restarting did not solve).
Also, seeing this in the log when I either start or stop the DHCPv6 server.
Apr 24 12:42:19 pfsense dhcpleases: Could not deliver signal HUP to process because its pidfile does not exist, No such process.Also, seeing this in the log file:
kernel: cannot forward src fe80:2::5d68:[redacted]:1262, dst 2001:470:[redacted]:2, nxt 17, rcvif em1, outif gif0 -
Well it shouldn't be trying to forward fe80 traffic, since that's link-local it should never leave.
-
The leases are all for the same IP, though the times are different.
It's almost as if it's not able to properly erase/rewrite the file when the lease is updated. I'm not sure if/how dhcpleases interacts with that though. That's more of a question for Ermal or maybe Renato
-
I downgraded from Squid3 to Squid2 and the problem is gone.
Edit:
No, the bug is back today:
-rw-r–r-- 1 root 65 19485720 Apr 25 2013 dhcpd6.leases
-rw-r--r-- 1 1002 65 19559977 Apr 25 16:00 dhcpd6.leases~
-rw-r--r-- 1 root 65 186 Apr 25 16:00 dhcpd.leases
-rw-r--r-- 1 1002 65 186 Apr 25 07:23 dhcpd.leases~