Peter Eriksson <peter at ifm.liu.se>
Hi Peter,
2011/5/26 Peter Eriksson <peter at ifm.liu.se>
> 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.
>
> 1. It was leaking non-handled processes - slowly filling up our machines
> process tables... solved with a signal(SIGCHLD, SIG_IGN)
>
> 2. It was blindingly waiting for a connect() call to time out (takes
> 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
> false alarms... Solved with a set_alarm()/clear_alarm() wrapper around the
> upscl_connect() call.
>
thanks for your patch. I've got to check it more thoroughly, but it will at
least need some rework.
as an example, the "signal(SIGCHLD, SIG_IGN)" should be in
"setup_signals(void)" and use "sigaction" for more
portability.
a side question: is there any reason you also commented "signal(SIGALRM,
SIG_IGN)" in "clear_alarm()"?
I'm running out of time to integrate it in 2.6.1, but will consider for the
next.
thanks for your contribution,
Arnaud
--
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20110915/3f6cfaa1/attachment.html>