Hello all,<div><br></div><div>I have noticed that in the OpenDNSSEC trunk, ods-signerd accumulates a connection to /var/run/opendnssec/engine.sock each time a command is issued to the signer. Eventually, ods-signerd will stop operating when the open file limit is reached.</div>
<div><br></div><div>strace reveals ods-signerd is doing the following once it hits 1024 open files:</div><div>...</div><div>[pid 4021] select(6, [5], NULL, NULL, NULL) = 1 (in [5])</div><div>[pid 4021] accept(5, 0x7f1109b1ce20, [110]) = -1 EMFILE (Too many open files)</div>
<div>[pid 4021] select(6, [5], NULL, NULL, NULL) = 1 (in [5])</div><div>[pid 4021] accept(5, 0x7f1109b1ce20, [110]) = -1 EMFILE (Too many open files)</div><div>...</div><div><br></div><div>It looks like in ./src/daemon/cmdhandler.c, close is never called on the socket that is opened by cmdhandler_start(). The following patch seems to resolve the problem for me:</div>
<div><br></div><div><div>--- cmdhandler.c<span class="Apple-tab-span" style="white-space:pre"> </span>(revision 4141)</div><div>+++ cmdhandler.c<span class="Apple-tab-span" style="white-space:pre"> </span>(working copy)</div>
<div>@@ -857,6 +857,8 @@</div><div> void</div><div> cmdhandler_cleanup(cmdhandler_type* cmdhandler)</div><div> {</div><div>+ if (cmdhandler->client_fd > 0)</div><div>+ close(cmdhandler->client_fd);</div>
<div> if (cmdhandler) {</div><div> se_free((void*)cmdhandler);</div><div> } else {</div></div><div><br></div><div><br></div><div>Cheers,</div><div>James Dempsey</div><div><br></div>