Project

General

Profile

Bug #831

Status -> System logs - > DHCP bug

Added by Bipin Chandra almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
08/20/2010
Due date:
% Done:

100%

Estimated time:
Affected Version:
2.0
Affected Architecture:

Description

usually under system log, all the different tabs show the log, now under each is a clear log button on clicking which, the list goes blank and then later newer entries again fill up the list but this doesnt happen for the DHCP tab, if u clear it once then it never populates again untill pfsense is rebooted. This is under nanobsd on alix

Associated revisions

Revision bd961c65 (diff)
Added by Jim Pingle almost 9 years ago

Fixes #831. Restart the DHCP daemon when clearing the log file.

History

#1 Updated by Ermal Lu├ži almost 9 years ago

I cannot see anything wrong in code regarding specifics to dhcp!

Can you please show the output of ls /var/log
and also /var/etc/syslog.conf or /etc/syslog.conf

#2 Updated by Bipin Chandra almost 9 years ago

$ ls /var/log
apinger.log
dhcpd.log
dmesg.boot
filter.log
ipsec.log
l2tp.log
lastlog
lighttpd.error.log
lighttpd.log
ntpd.log
openvpn.log
portalauth.log
ppp.log
pppoe.log
pptp.log
relayd.log
slbd.log
system.log
userlog
vpn.log

/var/etc/syslog.conf
ntpd
.* %/var/log/ntpd.log
!ppp
.* %/var/log/ppp.log
!pptp
.* %/var/log/pptp.log
!pppoe
.* %/var/log/pppoe.log
!l2tp
.* %/var/log/l2tp.log
!racoon
.* %/var/log/ipsec.log
!openvpn
.* %/var/log/openvpn.log
!apinger
.* %/var/log/apinger.log
!relayd
.* %/var/log/relayd.log
!-ntpd,racoon,openvpn
local0.
%/var/log/filter.log
local3.* %/var/log/vpn.log
local4.* %/var/log/portalauth.log
local7.* %/var/log/dhcpd.log
.notice;kern.debug;lpr.info;mail.crit; %/var/log/system.log
news.err;local0.none;local3.none;local4.none; %/var/log/system.log
local7.none %/var/log/system.log
security.
%/var/log/system.log
auth.info;authpriv.info;daemon.info %/var/log/system.log
auth.info;authpriv.info |exec /usr/local/sbin/sshlockout_pf
*.emerg *

/etc/syslog.conf
ntpd
.* %/var/log/ntpd.log
!ppp
.* %/var/log/ppp.log
!pptp
.* %/var/log/pptp.log
!pppoe
.* %/var/log/pppoe.log
!l2tp
.* %/var/log/l2tp.log
!racoon
.* %/var/log/ipsec.log
!openvpn
.* %/var/log/openvpn.log
!apinger
.* %/var/log/apinger.log
!relayd
.* %/var/log/relayd.log
!-ntpd,racoon,openvpn
local0.
%/var/log/filter.log
local3.* %/var/log/vpn.log
local4.* %/var/log/portalauth.log
local7.* %/var/log/dhcpd.log
.notice;kern.debug;lpr.info;mail.crit; %/var/log/system.log
news.err;local0.none;local3.none;local4.none; %/var/log/system.log
local7.none %/var/log/system.log
security.
%/var/log/system.log
auth.info;authpriv.info;daemon.info %/var/log/system.log
auth.info;authpriv.info |exec /usr/local/sbin/sshlockout_pf
*.emerg *

#3 Updated by Bipin Chandra almost 9 years ago

basically what im trying to say is when pfsense is booted fresh and then u go to dhcp log and u can see entries in it dhcp lease and renew etc and if u leave it as it is then entries keep increasing over time based on clients coming online and offline but suppose if u click clear log then existing ertires r removed but also no new entries r ever listed till pfsense is rebooted so the portion when clear log is clicked, that needs to be checked coz it works fine for system, firewall, ppp etc

#4 Updated by Jim Pingle almost 9 years ago

If you restart the DHCP daemon from Status > Services, does the logging resume? What about pressing "Save" on the System Logs setting tab?

#5 Updated by Bipin Chandra almost 9 years ago

haven't tried that but ill do that and report back

#6 Updated by Bipin Chandra almost 9 years ago

tried that and after restarting dhcp daemon, logging resumes as normal.

#7 Updated by Jim Pingle almost 9 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#8 Updated by Bipin Chandra almost 9 years ago

isnt this wrong to start dhcp daemon again in order to clear log, then u might as well just name the button restart dhcp instead of clear log, if its clear log then its supposed to only clear the log file but i guess in the process the file permission goes wrong or something else after which dhcp daemon isnt able to write to the log file and thats what needs to be corrected rather than have a temporary solution of simply restarting the daemon.

#9 Updated by Jim Pingle almost 9 years ago

Then do a little more testing and research to find out. Since you can easily replicate the issue, you can see the log file permissions before and after pressing the button.

I suspect that it isn't a permissions issue, but it needs at least a kill -HUP to reopen the file. If a kill -HUP is sufficient, then that could be done instead.

#10 Updated by Bipin Chandra almost 9 years ago

i get this is system log, no idea if its normal or no

Aug 21 16:50:48 php: /diag_logs_dhcp.php: The command '/sbin/ifconfig '' -staticarp ' returned exit code '1', the output was 'ifconfig: interface does not exist'
Aug 21 16:50:48 php: /diag_logs_dhcp.php: The command '/usr/sbin/arp -d -i '' -a > /dev/null 2>&1 ' returned exit code '1', the output was ''

#11 Updated by Jim Pingle over 8 years ago

Tried it myself with -HUP and the DHCP daemon just died, so that won't work. The clear_log_file() function already kills and restarts syslogd, so that alone doesn't work either. It doesn't look like we have any other choice but to restart dhcpd fully in order for logging to resume.

I don't get those interface errors. What kind of interfaces do you have assigned? When the DHCP daemon is restarted it loops through all of the interfaces on the system and tries to adjust the ARP settings there. Somehow it's picking up a blank interface. It's getting pretty far off this topic though so you might want to start a new ticket and attach a sanitized version of your config to it. If there isn't anything odd in your config I could at least check for a blank interface when calling those functions to be sure they are never called on an empty interface name.

#13 Updated by Chris Buechler over 8 years ago

  • Status changed from Feedback to Resolved

#14 Updated by Peter O over 8 years ago

What happens when you just clear the file instead of removing and re-creating the file? I've seen more programs having trouble using a new logfile, emptying out the original logfile almost always did the trick.

#15 Updated by Jim Pingle over 8 years ago

Hard to say right now since the upgrade to a new version of the DHCP daemon has caused an issue with logging.

It might be worth trying to truncate the file instead of removing, but I don't see that big of a problem with just restarting the DHCP daemon. It's not an action that will be taken very often, and the user is made aware of the action.

#16 Updated by Bipin Chandra over 8 years ago

i guess this needs to be opened again as currently the dhcp log doesn't show anything after the upgrade

#17 Updated by Jim Pingle over 8 years ago

That is a completely different issue that needs a new ticket.

Also available in: Atom PDF