[Nut-upsuser] Bug#439055: hid driver tries to mmap huge area, fails

Justin Piszcz jpiszcz at lucidpixels.com
Sat Sep 8 12:52:51 UTC 2007



On Sat, 8 Sep 2007, Justin Piszcz wrote:

>
>
> On Sat, 8 Sep 2007, Justin Piszcz wrote:
>
>>
>>
>> On Sat, 8 Sep 2007, Justin Piszcz wrote:
>>
>>>
>>>
>>> On Sat, 8 Sep 2007, Justin Piszcz wrote:
>>>
>>>>
>>>>
>>>> On Sat, 8 Sep 2007, Justin Piszcz wrote:
>>>>
>>>>>
>>>>>
>>>>> On Sat, 8 Sep 2007, Charles Lepple wrote:
>>>>>
>>>>>> On 9/8/07, Justin Piszcz <jpiszcz at lucidpixels.com> wrote:
>>>>>>> $ ./configure --with-user=nut --with-group=nut
>>>>>>> --prefix=/app/nut-trunk-1091
>>>>>>>
>>>>>>> checking sys/time.h presence... yes
>>>>>>> checking for sys/time.h... yes
>>>>>>> ./configure: line 5460: NUT_TYPE_SOCKLEN_T: command not found
>>>>>>> ./configure: line 5461: NUT_TYPE_UINT16_T: command not found
>>>>>>> ./configure: line 5462: NUT_TYPE_UINT8_T: command not found
>>>>>>> checking for --with-all... not given
>>>>>>> ./configure: line 5492: syntax error near unexpected token `serial,'
>>>>>>> ./configure: line 5492: `NUT_ARG_WITH(serial, build and install serial
>>>>>>> drivers, yes)'
>>>>>>>
>>>>>>> autoconf/automake do not produce a working configure and no configure in
>>>>>>> trunk?
>>>>>>
>>>>>> This looks like you need to run autoreconf. It will re-run autoconf
>>>>>> and automake, but will also include all of the NUT-specific macros in
>>>>>> the m4/ directory. Also, be sure that you do not have automake-1.4
>>>>>> installed at all, and you have a later version of automake, such as
>>>>>> 1.8 or 1.9.
>>>>>>
>>>>>> --
>>>>>> - Charles Lepple
>>>>>>
>>>>>
>>>>> By the way, ./configure --prefix=/app/nut-2.2.0-r1090:
>>>>>
>>>>> Making install in scripts
>>>>> make[1]: Entering directory `/home/war/nut-2.2.0-r1090/scripts'
>>>>> Making install in hotplug
>>>>> make[2]: Entering directory `/home/war/nut-2.2.0-r1090/scripts/hotplug'
>>>>> make[3]: Entering directory `/home/war/nut-2.2.0-r1090/scripts/hotplug'
>>>>> make[3]: Nothing to be done for `install-exec-am'.
>>>>> test -z "/etc/hotplug/usb" || /bin/mkdir -p "/etc/hotplug/usb"
>>>>>  /usr/bin/install -c -m 644 'libhid.usermap'
>>>>> '/etc/hotplug/usb/libhid.usermap'
>>>>> /usr/bin/install: cannot create regular file
>>>>> `/etc/hotplug/usb/libhid.usermap': Permission denied
>>>>> make[3]: *** [install-dist_hotplugusbDATA] Error 1
>>>>> make[3]: Leaving directory `/home/war/nut-2.2.0-r1090/scripts/hotplug'
>>>>> make[2]: *** [install-am] Error 2
>>>>> make[2]: Leaving directory `/home/war/nut-2.2.0-r1090/scripts/hotplug'
>>>>> make[1]: *** [install-recursive] Error 1
>>>>> make[1]: Leaving directory `/home/war/nut-2.2.0-r1090/scripts'
>>>>> make: *** [install-recursive] Error 1
>>>>> Command exited with non-zero status 2
>>>>> 1.90user 1.52system 0:03.40elapsed 100%CPU (0avgtext+0avgdata
>>>>> 0maxresident)k
>>>>> 0inputs+0outputs (0major+684410minor)pagefaults 0swaps
>>>>>
>>>>> Justin.
>>>>>
>>>>> _______________________________________________
>>>>> Nut-upsuser mailing list
>>>>> Nut-upsuser at lists.alioth.debian.org
>>>>> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>>>>>
>>>>
>>>> Version 1090:
>>>>
>>>> Sep  8 08:36:52 p34 last message repeated 3 times
>>>> Sep  8 08:36:54 p34 upsd[2099]: Connection from 127.0.0.1
>>>> Sep  8 08:36:54 p34 upsd[2099]: Client on 127.0.0.1 logged out
>>>> Sep  8 08:36:57 p34 upsd[2099]: Connection from 127.0.0.1
>>>> Sep  8 08:36:57 p34 upsd[2099]: Client on 127.0.0.1 logged out
>>>> Sep  8 08:36:57 p34 upsmon[2112]: Poll UPS [belkin at localhost] failed -
>>>> Driver not connected
>>>> Sep  8 08:37:27 p34 last message repeated 6 times
>>>> Sep  8 08:37:32 p34 upsd[2099]: Connection from 127.0.0.1
>>>> Sep  8 08:37:32 p34 upsd[2099]: Client on 127.0.0.1 logged out
>>>> Sep  8 08:37:32 p34 upsmon[2112]: Poll UPS [belkin at localhost] failed -
>>>> Driver not connected
>>>> Sep  8 08:38:07 p34 last message repeated 7 times
>>>>
>>>> Justin.
>>>>
>>>>
>>>> _______________________________________________
>>>> Nut-upsuser mailing list
>>>> Nut-upsuser at lists.alioth.debian.org
>>>> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>>>>
>>>
>>> Configuration summary:
>>> enable SSL development code: yes
>>> enable IPv6 support: yes
>>> build CGI programs: yes
>>> build upsclient library: yes
>>> build serial drivers: yes
>>> build SNMP drivers: yes
>>> build USB drivers: yes
>>> enable HAL support: yes
>>>
>>> This should help :)
>>>
>>> In file included from main-hal.c:23:
>>> dstate-hal.h:28:18: error: glib.h: No such file or directory
>>> dstate-hal.h:29:28: error: dbus/dbus-glib.h: No such file or directory
>>> dstate-hal.h:30:37: error: dbus/dbus-glib-lowlevel.h: No such file or
>>> directory
>>> In file included from main-hal.c:23:
>>> dstate-hal.h:53: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'dbus_init_local'
>>>
>>> Ok will just try USB.
>>>
>>> Same issues:
>>>
>>> Sep  8 08:45:55 p34 upsd[11770]: Client belkin at 127.0.0.1 logged into UPS
>>> [belkin]
>>> Sep  8 08:45:55 p34 upsmon[11893]: Poll UPS [belkin at localhost] failed -
>>> Driver not connected
>>> Sep  8 08:45:55 p34 upsmon[11893]: Communications with UPS
>>> belkin at localhost lost
>>> Sep  8 08:45:57 p34 upsmon[2112]: Poll UPS [belkin at localhost] failed -
>>> Driver not connected
>>> Sep  8 08:46:00 p34 upsmon[11893]: Poll UPS [belkin at localhost] failed -
>>> Driver not connected
>>> Sep  8 08:46:00 p34 upsmon[11893]: UPS belkin at localhost is unavailable
>>> Sep  8 08:46:02 p34 upsmon[2112]: Poll UPS [belkin at localhost] failed -
>>> Driver not connected
>>> Sep  8 08:46:02 p34 upsd[11770]: Host 127.0.0.1 disconnected (read
>>> failure)
>>> Sep  8 08:46:02 p34 upsd[11770]: Host 127.0.0.1 disconnected (read
>>> failure)
>>> Sep  8 08:46:22 p34 upsd[11770]: Connection from 127.0.0.1
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Nut-upsuser mailing list
>>> Nut-upsuser at lists.alioth.debian.org
>>> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>>>
>>
>> Hmm, closer.
>>
>> p34:/app/nut-2.2.0-r1090/bin# ./usbhid-ups -a belkin
>> Network UPS Tools: 0.28 USB communication driver 0.28 - core 0.30
>> (2.2.0-r1090)
>>
>> Detected a UPS:        /UPS
>> Using subdriver: Belkin HID 0.1
>>
>> Fatal error: unable to create listener socket
>>
>> bind /var/state/ups/usbhid-ups-belkin failed: Address already in use
>>
>> Exiting.
>> p34:/app/nut-2.2.0-r1090/bin#
>>
>> (even though its not really listening)
>>
>> _______________________________________________
>> Nut-upsuser mailing list
>> Nut-upsuser at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>>
>
> Well that's a bug!
>
>> bind /var/state/ups/usbhid-ups-belkin failed: Address already in use
>
> chmod 777 /var/state/ups
>
>>> Problem solved.
>
> upsdrv_updateinfo...
>
> =>Got 1 HID Objects...
> upsdrv_updateinfo...
> upsdrv_updateinfo...
>
> =>Got 1 HID Objects...
> upsdrv_updateinfo...
>
> =>Got 1 HID Objects...
> upsdrv_updateinfo...
> upsdrv_updateinfo...
>
> =>Got 1 HID Objects...
>
>
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>

Ok so this is how I am testing:

In 1 window:

p34:/app/nut-2.2.0-r1090/sbin# ./upsd -f

In 2nd window:

p34:/app/nut-2.2.0-r1090/bin# ./usbhid-ups -a belkin -D

p34:/etc# upsc belkin at localhost
battery.charge: 100
battery.charge.low: 30
battery.charge.warning: 50
battery.runtime: 210
battery.type: PbAc
battery.voltage: 27.1
battery.voltage.nominal: 24
driver.name: usbhid-ups
driver.parameter.pollfreq: 5
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.2.0-r1090
driver.version.data: Belkin HID 0.1
driver.version.internal: 0.30
input.frequency: 59.8
input.frequency.nominal: 60
input.sensitivity: normal
input.transfer.high: 136
input.transfer.high.max: 141
input.transfer.high.min: 131
input.transfer.low: 90
input.transfer.low.max: 95
input.transfer.low.min: 85
input.voltage: 123.3
input.voltage.nominal: 120
output.frequency: 59.8
output.voltage: 122.7
ups.beeper.status: enabled
ups.delay.restart: 0
ups.delay.shutdown: 0
ups.firmware: 4
ups.load: 33
ups.load.high: 100
ups.mfr: Belkin
ups.mfr.date: 2002/03/01
ups.model: UPS
ups.power.nominal: 1200
ups.productid: 0912
ups.serial: <omitted>
ups.status: OL CHRG
ups.test.result: No test initiated
ups.type: offline
ups.vendorid: 050d
p34:/etc#


Will let you know if I get the low battery warning!



More information about the Nut-upsuser mailing list