Peter Eriksson <<a href="mailto:peter@ifm.liu.se">peter@ifm.liu.se</a>><br>Hi Peter,<br><br><div class="gmail_quote">2011/5/26 Peter Eriksson <span dir="ltr"><<a href="mailto:peter@ifm.liu.se" target="_blank">peter@ifm.liu.se</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Please find enclosed a patch to NUT 2.6.0 that solves two long standing issues for us in "upsmon" when dealing with a remote host that is down that was supposed to be running a NUT daemon.<br>
<br>
1. It was leaking non-handled processes - slowly filling up our machines process tables... solved with a signal(SIGCHLD, SIG_IGN)<br>
<br>
2. It was blindingly waiting for a connect() call to time out (takes<br>
2 minutes) when it was trying to connect to the NUT daemon on the down remote host... It eventually gave up - but since the 2 minute timeout was pretty long - it also marked all other UPSes it was monitoring as "down" (and then immediately "up" again). Causing a lot of unncessary<br>


false alarms... Solved with a set_alarm()/clear_alarm() wrapper around the upscl_connect() call.<font color="#888888"></font><br></blockquote></div><br>thanks for your patch. I've got to check it more thoroughly, but it will at least need some rework.<br>

as an example, the "signal(SIGCHLD, SIG_IGN)" should be in "setup_signals(void)" and use "sigaction" for more portability.<br>a side question: is there any reason you also commented "signal(SIGALRM, SIG_IGN)" in "clear_alarm()"?<br>

<br>I'm running out of time to integrate it in 2.6.1, but will consider for the next.<br><br>thanks for your contribution,<br>Arnaud<br>-- <br>Linux / Unix Expert R&D - Eaton - <a href="http://powerquality.eaton.com" target="_blank">http://powerquality.eaton.com</a><br>

Network UPS Tools (NUT) Project Leader - <a href="http://www.networkupstools.org/" target="_blank">http://www.networkupstools.org/</a><br>Debian Developer - <a href="http://www.debian.org" target="_blank">http://www.debian.org</a><br>

Free Software Developer - <a href="http://arnaud.quette.free.fr/" target="_blank">http://arnaud.quette.free.fr/</a><br><br>