Ticket #332 (closed Bug report: fixed)
wdctl restart cause 3 new file descriptors to be created each time
|Reported by:||bigup||Owned by:||benoitg|
|Keywords:||file descriptor wdctl socket||Cc:|
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 :
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