Ticket #332 (closed Bug report: fixed)

Opened 15 years ago

Last modified 14 years ago

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:


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


patch_revision1239.patch Download (3.3 KB) - added by bigup 15 years ago.
patch for wifidog

Change History

Changed 15 years ago by bigup

patch for wifidog

Changed 15 years ago by bigup

Sorry, the component concerned is not the Auth server but wifidog gateway

Changed 15 years ago by bigup

i have seen another strange thing when monitoring the opened file descriptors :

when wifidog is started as a daemon, the three standards descriptors(input:0, output:1, and error:2) are still used instead closing these to detach from the console.

Changed 15 years ago by benoitg

  • owner set to benoitg
  • status changed from new to assigned
  • component changed from Auth server, Authentication to Gateway
  • milestone changed from Not yet assigned to a Milestone to Gateway 1.1.3

Changed 15 years ago by benoitg

  • priority changed from high to normal
  • status changed from assigned to closed
  • resolution set to fixed

Commited in [1241], thanks!

Note: See TracTickets for help on using tickets.