Ticket #332 (closed Bug report: fixed)
wdctl restart cause 3 new file descriptors to be created each time
Reported by: | bigup | Owned by: | benoitg |
---|---|---|---|
Priority: | normal | Milestone: | Gateway 1.1.3 |
Component: | Gateway | Version: | |
Keywords: | file descriptor wdctl socket | Cc: |
Description
Hi, i work with Medea which with we posted Ticket: #324
We have wifidog on production on Debian etch, and we use intensively the 'wdctl restart' (each hour) and we have found another bug : after some weeks of restarts wifidog stopped working :
Jun 5 14:49:02 wifidog-media wifidog[31472]: popen(): Too many open files Jun 5 14:49:02 wifidog-media wifidog[31472]: Could not get counters from firewall!
after investigations, 'lsof' and 'ls /proc/wifidog-pid/fd/' we found that each restart wifidog consume 3 more file descriptors.. so after long hours of chasing forgotten 'close()' there is some problems with the forked child after the restart :
1. the main wdctl socket /tmp/wdctl.socket is not closed before the fork so after reexecutinh hisself, wifidog reopen this one
2. same for the icmp ping socket in fw_init() not closed before fork.
3. forgotten close in the get_iface_ip() function in util.c:147
I have created a patch with the last svn version, i had to transform the main wdctl socket into a global to be able to close it in wdctl_restart().
Laurent Marchal. biguphpc<AT>gmail<DOT>com