Comment 14 for bug 753661

Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Bug 753661] Re: upsd write() failed for 127.0.0.1: Broken pipe

2011/4/18 Virus <email address hidden>

> yes, it 100 % reproducible.
>

I also managed to reproduce it using dummy-ups (the simulation driver) and
injecting the error on the same variable:
adding a newline (ie "\n") results in a broken pipe on upsc side.

> i am ready to test svn version.
>

ok, here we go:
1) checkout an svn copy using:
$ svn co svn://svn.debian.org/nut/trunk

2) configure it using (Debian arguments, limited for the current test scope
; should be sufficient):
--prefix=/usr \
            --exec-prefix=/ \
            --sysconfdir=/etc/nut \
            --mandir=/usr/share/man \
            --libdir=/lib \
            --includedir=/usr/include \
            --without-all \
            --with-usb \
            --enable-static \
            --with-statepath=/var/run/nut \
            --with-altpidpath=/var/run/nut \
            --with-drvpath=/lib/nut \
            --with-pidpath=/var/run/nut \
            --datadir=/usr/share/nut \
            --with-pkgconfig-dir=/usr/lib/pkgconfig \
            --with-user=nut --with-group=nut

3) apply the attached patch
$ patch -p0 < /path/to/virus.patch

4) make as usual, ie
$ make

5) stop all previous NUT instances, then launch the new driver and upsd
$ sudo drivers/usbhid-ups -a powercom
$ sudo server/upsd -DDD

6) now issue your "upsc of death"
$ upsc powercom

everything should behave fine.
Remember that it's a "blind patch": I've not validated the above configure
line, nor the patch itself!

cheers,
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/