<br><div class="gmail_quote">2009/8/6 Antoine Gatineau <span dir="ltr"><<a href="mailto:antoine.gatineau@alcatel-lucent.com">antoine.gatineau@alcatel-lucent.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Ok, you're right, it is indeed a permission
issue.</font></span></div></div></blockquote><div><br>this is a classic.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I have to chown root:dialout and chmod 0660 the
/proc/bus/usb/003/006... </font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">However this should have been done by udev rules. Here is
the line for my device :</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"># various models -
usbhid-ups<br>ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", MODE="664",
GROUP="dialout"</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">It works well if I use the option -u root. I prefer to use
usermode instead of super user if possible.</font></span></div></div></blockquote><div><br>running as root was just to test and validate the issue.<br>in no way you should use it in production!<br><br>you have to troobleshoot why the nut rule isn't applied:<br>
- check the location (/etc/udev/rules.d) and the permissions of the files (do the same as for others)<br>- restart udev<br>- optionaly use "udevadm monitor" before plugging your UPS' USB cord...<br><br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span></div>
<div dir="ltr" align="left"><span><span><font size="2" face="Arial" color="#0000ff">In case there is
a infinite loop or any misbehavior in usbhid-ups (or any driver), will it make a
difference to run it as "nut" user instead of root. I mean towards other
applications?</font></span></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">By the way I found this in the mailing list archive (from
Charles Lepple) :</font></span></div>
<div dir="ltr" align="left"><span>"When I plug in the USB
cable I get the following message in my system log:<br><br>kernel: usbhid: probe
of 2-1:1.0 failed with error -5</span></div>
<div dir="ltr" align="left"><span>actually, this part is
normal. The device is blacklisted from the<br>kernel usbhid driver so that it
can be claimed in userspace by<br>newhidups.<br><br>Did you see any error
messages from the driver or other NUT components?"</span></div>
</div></blockquote><div> <br>the above is not true since 2.6.26 (or 24 I don't recall exactly).<br>I've once blacklisted MGE units in the kernel because:<br>- the work we did with Vojtech and Paul on the kernel stack (usbhid -> hiddev) was not stable. At that, I rewrote the usb driver (from the old hidups, relying on the above kernel driver to newhidups now called usbhid-ups).<br>
- the blacklist entries never stopped from attaching from userland. but simply from attaching the kernel land hiddev driver...<br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div dir="ltr" align="left"></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I even tried to use the old rules from nut-2.2.0 but it
doesn't work.</font></span></div>
<div dir="ltr" align="left"><font style="background-color: rgb(255, 255, 255);" size="2" face="Arial" color="#0000ff"><span>The only solution I see is
to always use -u root. So I modified ups init script to call upsdrvctl with
option "-u root". Don't forget do set UPSD_OPTIONS="-u root" in
/etc/sysconfig/ups after installation.</span></font></div>
<div><font size="2" face="Arial" color="#0000ff"></font> </div>
<div><span><font size="2" face="Arial" color="#0000ff">How do
I send you the RPM for redistribution?</font></span></div>
<div><span></span></div></div></blockquote><div><br>post a URL for the moment. but I doubt we'll use these. maybe some other will find it useful though.<br><br></div><div>cheers,<br>Arnaud<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" lang="fr" align="left">
<hr>
<font size="2" face="Tahoma"><div class="im"><b>De :</b> Arnaud Quette
[mailto:<a href="mailto:aquette.dev@gmail.com" target="_blank">aquette.dev@gmail.com</a>] <br></div><b>Envoyé :</b> mercredi 5 août 2009
16:42<div><div></div><div class="h5"><br><b>À :</b> Antoine Gatineau<br><b>Cc :</b>
nut-upsuser<br><b>Objet :</b> Re: [Nut-upsuser] Usbhip-ups going
wild<br></div></div></font><br></div><div><div></div><div class="h5">
<div></div><br><br>
<div class="gmail_quote">2009/8/5 Antoine Gatineau <span dir="ltr"><<a href="mailto:antoine.gatineau@alcatel-lucent.com" target="_blank">antoine.gatineau@alcatel-lucent.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Well,
</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I have
unfortunately uplugged the usb cord. Now I am not able to start the drivers
again.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">When I
plug in the usb cord I get : </font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Aug
5 16:23:33 localhost kernel: usb 3-2: new low speed USB device using address
6<br>Aug 5 16:23:34 localhost kernel: usbhid: probe of 3-2:1.0 failed
with error -5</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">When I
start the nut driver using upsdrvctl start, I get :</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Aug
5 16:24:05 localhost upsdrvctl: Can't claim USB device [0463:ffff]: could not
detach kernel driver from interface 0: Operation not
permitted</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Aug
5 16:24:05 localhost upsdrvctl: Network UPS Tools - Generic HID driver 0.34
(2.4.1)<br>Aug 5 16:24:05 localhost upsdrvctl: USB communication driver
0.31<br>Aug 5 16:24:05 localhost upsdrvctl: Network UPS Tools - UPS
driver controller 2.4.1<br>Aug 5 16:24:05 localhost upsdrvctl: Driver
failed to start (exit status=1)</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I gess
there are some conflicts somewhere. What is really wierd is that I get the
same messages after reboot or reinstallation of the rpms.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Any
idea?</font></span></div></div></blockquote>
<div><font size="2" face="Arial" color="#0000ff"></font><br>check that your hotplug or
udev file is installed correctly, and that the permissions on the USB device are
correctly set (using the lsusb + ls -l /dev/bus/usb/XXX/YYY method)<br><br>to
first validate that it's a device perm issue, simply launch the driver as root,
ie:<br>$ /path/to/usbhid-ups -a <ups><br><br>this should start and happily
says "Detected something..."<br><br>cheers,<br>Arnaud<br>-- <br>Linux / Unix
Expert R&D - Eaton - <a href="http://www.eaton.com/mgeops" target="_blank">http://www.eaton.com/mgeops</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></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br>
<div dir="ltr" lang="fr" align="left">
<hr>
<font size="2" face="Tahoma">
<div><b>De :</b> Arnaud Quette [mailto:<a href="mailto:aquette.dev@gmail.com" target="_blank">aquette.dev@gmail.com</a>]
<br></div><b>Envoyé :</b> mercredi 5 août 2009 11:16
<div>
<div></div>
<div><br><b>À :</b> Antoine Gatineau<br><b>Cc :</b>
nut-upsuser<br><b>Objet :</b> Re: [Nut-upsuser] Usbhip-ups going
wild<br></div></div></font><br></div>
<div>
<div></div>
<div>
<div></div><br>
<div class="gmail_quote">2009/8/4 Antoine Gatineau <span dir="ltr"><<a href="mailto:antoine.gatineau@alcatel-lucent.com" target="_blank">antoine.gatineau@alcatel-lucent.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Hello
everyone,</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span></div></div></blockquote>
<div><br>Hi Antoine,<br> <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I have
nut and nut-client installed from rpm, up and running without any error in
the logs or at screen.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">upsc
gives me the state of the battery and stuff. It seems
functional.</font></span></div></div></blockquote>
<div><br>nice<br> <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Is there
something to do in order to verify the health of the whole chain? (upsmon
-> upsd -> upsdrv)</font></span></div></div></blockquote>
<div><font size="2" face="Arial" color="#0000ff"></font><br>yep, unplug the UPS'
power cord, and check that upsc has an ups.status = OB<br><br> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">One last
question, after installing the rpms, /var/state/ups is not created and the
rights are not given like it should. I was suprised to see that this was not
ntegrated in RHEL5 rpms... Is there some restriction to integrate that
configuration?</font></span></div></div></blockquote>
<div><font size="2" face="Arial" color="#0000ff"></font><br>most modern distro have
a volatile /var fs. For example, on Debian, the init.d script create these
dirs at launch time...<br><br>cheers,<br>Arnaud<br>-- <br>Linux / Unix Expert
R&D - Eaton - <a href="http://www.eaton.com/mgeops" target="_blank">http://www.eaton.com/mgeops</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></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><br>
<div dir="ltr" lang="fr" align="left">
<hr>
<font size="2" face="Tahoma">
<div><b>De :</b> Arnaud Quette [mailto:<a href="mailto:aquette.dev@gmail.com" target="_blank">aquette.dev@gmail.com</a>]
<br></div><b>Envoyé :</b> lundi 3 août 2009 21:46
<div><br><b>À :</b> Antoine Gatineau<br><b>Cc :</b>
nut-upsuser<br><b>Objet :</b> Re: [Nut-upsuser] Usbhip-ups going
wild<br></div></font><br></div>
<div></div><br>
<div>
<div></div>
<div><br>
<div class="gmail_quote">2009/8/3 Antoine Gatineau <span dir="ltr"><<a href="mailto:antoine.gatineau@alcatel-lucent.com" target="_blank">antoine.gatineau@alcatel-lucent.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I
tried to recompile without xorg-x11-devel and I get this error
:</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">configure: error: libgd not found, required for CGI
build.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">It is
indeed required for nut-cgi</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">udev-devel, however, is not required.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div></div></blockquote>
<div><br>yup, you got me wrong: only the dbus-glib as to be removed.
xorg-devel (or xpm-devel) is needed for nut-cgi<br> <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">Anyway
I made it build correctly.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I
attached nut.spec (modified for RHEL4) and nut.spec.ori (original spec
file for RHEL5) for info.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">There
were no %files entry for libhidups,
libhid.usermap</font></span></div></div></blockquote>
<div><br>these 2 are for hotplug. if you use udev, you don't need
these.<br> <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">and
20-ups-nut-device.fdi</font></span></div></div></blockquote>
<div><br>this file is for HAL. so not needed too.<br> <br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">in the
original spec file, so I added them. I'm not an rpm building expert but I
wonder how it could work...</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I also
removed hal, powerman and netxml-ups man page and related files as they
are not used in this package.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">I
didn't test it running yet but I expect it to be OK. I'll come back to you
with results. </font></span></div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" face="Arial" color="#0000ff">BTW,
in the first answer to this (too?) long thread, Arjen said that there
were lot of bug fixes and performance improvement done since nut-2.2.0. Is
there a bug tracker to seek if my issues will be solved with this new
one?</font></span></div></div></blockquote>
<div><br>to be short: ChangeLog<br><br>cheers<br></div>Arnaud<br></div>--
<br>Linux / Unix Expert R&D - Eaton - <a href="http://www.eaton.com/mgeops" target="_blank">http://www.eaton.com/mgeops</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></div></div></div></blockquote></div><br><br clear="all"><br><br></div></div></div></blockquote></div>
<br><br clear="all"><br></div></div></div>
</blockquote></div><br><br>