Mailinglist Archive: opensuse (1986 mails)
| < Previous | Next > |
Re: [opensuse] Attempting (and failing) to use my UPS
- From: "Carlos E. R." <robin.listas@xxxxxxxxxxxxxx>
- Date: Wed, 19 Nov 2008 02:18:59 +0100 (CET)
- Message-id: <alpine.LSU.2.00.0811190131380.6163@xxxxxxxxxxxxxxxx>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday, 2008-11-18 at 10:44 -0500, Patrick Shanahan wrote:
It appears that with my UPS this entry is ignored entirely, does not matter.
Yes, indeed it has problems with permissions.
First, I changed the script /etc/init.d/upsd to see what is hapening:
#$UPSDRVCTL_BIN start >/dev/null 2>&1 || rc_failed
$UPSDRVCTL_BIN start >/tmp/ups.log 2>&1 || rc_failed
and it says:
Megatec protocol UPS detected.
Startup timer elapsed, continuing...
Network UPS Tools - UPS driver controller 2.2.2
it certainly aborts at 45". As root I can see my UPS like this:
nimrodel:/etc/init.d # /usr/lib/ups/driver/megatec_usb -DDDD -a myups
Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb]
Carlos Rodrigues (c) 2003-2008
Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007
debug level is '4'
Checking device (0665/5161) (003/026)
- - VendorID: 0665
- - ProductID: 5161
- - Manufacturer: Cypress Semiconductor
- - Product: USB to Serial
- - Serial Number: unknown
- - Bus: 003
Trying to match device
Device matches
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => OK [(231.3 231.3 230.8 020 49.9 13.6 25.0 00001001]
...
etc.
It does see when I pull the cable:
Asking for UPS status [Q1]...
Q1 => OK [(005.8 235.2 227.0 022 50.1 12.0 25.0 10001001]
Calculated battery charge: 57.5%
Asking for UPS status [Q1]...
Q1 => OK [(234.7 234.7 234.7 018 49.9 12.6 25.0 00001001]
Calculated battery charge: 72.5%
So I know that it is indeed the megatec_usb driver.
I again changed the startup script:
strace -ff -o /tmp/ups_trace $UPSDRVCTL_BIN start >/tmp/ups.log 2>&1 ||
rc_failed
I get a side effect that it never exits, i have to kill it; but I now know what the problem is, or seems to be.
/tmp/ups_trace.5352 /usr/lib/ups/driver/upsdrvctl
this one starts a child:
/tmp/ups_trace.5353 /usr/lib/ups/driver/megatec_usb
The problem seems to be here, whenit attempts to access the usb bus:
open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/003/001", O_RDONLY) = 5
ioctl(5, USBDEVFS_CONNECTINFO, 0xbfff3834) = -1 EPERM (Operation not permitted)
...
ioctl(4, USBDEVFS_IOCTL, 0xbfff57cc) = -1 ENOTTY (Inappropriate ioctl for
device)
close(4) = 0
open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/003/001", O_RDONLY) = 4
ioctl(4, USBDEVFS_IOCTL, 0xbfff57cc) = -1 EPERM (Operation not permitted)
and then seems to wait for ever here:
ioctl(4, USBDEVFS_SETINTERFACE, 0xbfff58a4) = 0
gettimeofday({1227040766, 257390}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfff7024) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [4], NULL, {0, 1000}) = 0 (Timeout)
gettimeofday({1227040766, 257974}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
gettimeofday({1227040766, 261832}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
There is a third process, that I can't see its name, in /tmp/ups_trace.5389:
gettimeofday({1227040824, 883850}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfff6f84) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff6fc8) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [4], NULL, {0, 1000}) = 0 (Timeout)
gettimeofday({1227040824, 885955}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff6fc8) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
But I can't see which file is described by '5'.
I have tried "RUN_AS_USER root" in upsmon.conf to no avail. If I use:
[myups]
# "BELKIN Active Battery Backup"
driver = megatec_usb
port = auto
desc = "Local UPS"
user = root
but the driver complains it does not recognise the "user" option. Currently I have this startup line:
$UPSDRVCTL_BIN -u root start || rc_failed
which is verbose but does not work, either.
I have been pointed to this email:
<http://lists.alioth.debian.org/pipermail/nut-upsuser/2008-February/003753.html>
and it appears that my particular UPS model works with the development version of the software. I will have to try that next.
- -- Cheers,
Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEARECAAYFAkkjaYUACgkQtTMYHG2NR9UuTgCfbVULsHukBNYW5DD8NmLYLSLr
KLkAoI4keaB1AxflpHjg5cm2mymHf7qO
=XRlM
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
Hash: SHA1
On Tuesday, 2008-11-18 at 10:44 -0500, Patrick Shanahan wrote:
So in '/etc/ups/ups.conf' I configured it thus:
[myups]
driver = megatec_usb
port = /dev/hiddev0
desc = "Local UPS"
Wouldn't work with mine, either. I changed "port =" to
port = auto
It appears that with my UPS this entry is ignored entirely, does not matter.
has to be something wrong with permissions ??
Yes, indeed it has problems with permissions.
First, I changed the script /etc/init.d/upsd to see what is hapening:
#$UPSDRVCTL_BIN start >/dev/null 2>&1 || rc_failed
$UPSDRVCTL_BIN start >/tmp/ups.log 2>&1 || rc_failed
and it says:
Megatec protocol UPS detected.
Startup timer elapsed, continuing...
Network UPS Tools - UPS driver controller 2.2.2
it certainly aborts at 45". As root I can see my UPS like this:
nimrodel:/etc/init.d # /usr/lib/ups/driver/megatec_usb -DDDD -a myups
Network UPS Tools 2.2.2 - Megatec protocol driver 1.5.14 [megatec_usb]
Carlos Rodrigues (c) 2003-2008
Serial-over-USB transport layer for Megatec protocol driver [megatec_usb]
Andrey Lelikov (c) 2006, Alexander Gordeev (c) 2006-2007, Jon Gough (c) 2007
debug level is '4'
Checking device (0665/5161) (003/026)
- - VendorID: 0665
- - ProductID: 5161
- - Manufacturer: Cypress Semiconductor
- - Product: USB to Serial
- - Serial Number: unknown
- - Bus: 003
Trying to match device
Device matches
Starting UPS detection process...
Asking for UPS status [Q1]...
Q1 => OK [(231.3 231.3 230.8 020 49.9 13.6 25.0 00001001]
...
etc.
It does see when I pull the cable:
Asking for UPS status [Q1]...
Q1 => OK [(005.8 235.2 227.0 022 50.1 12.0 25.0 10001001]
Calculated battery charge: 57.5%
Asking for UPS status [Q1]...
Q1 => OK [(234.7 234.7 234.7 018 49.9 12.6 25.0 00001001]
Calculated battery charge: 72.5%
So I know that it is indeed the megatec_usb driver.
I again changed the startup script:
strace -ff -o /tmp/ups_trace $UPSDRVCTL_BIN start >/tmp/ups.log 2>&1 ||
rc_failed
I get a side effect that it never exits, i have to kill it; but I now know what the problem is, or seems to be.
/tmp/ups_trace.5352 /usr/lib/ups/driver/upsdrvctl
this one starts a child:
/tmp/ups_trace.5353 /usr/lib/ups/driver/megatec_usb
The problem seems to be here, whenit attempts to access the usb bus:
open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/003/001", O_RDONLY) = 5
ioctl(5, USBDEVFS_CONNECTINFO, 0xbfff3834) = -1 EPERM (Operation not permitted)
...
ioctl(4, USBDEVFS_IOCTL, 0xbfff57cc) = -1 ENOTTY (Inappropriate ioctl for
device)
close(4) = 0
open("/dev/bus/usb/003/001", O_RDWR) = -1 EACCES (Permission denied)
open("/dev/bus/usb/003/001", O_RDONLY) = 4
ioctl(4, USBDEVFS_IOCTL, 0xbfff57cc) = -1 EPERM (Operation not permitted)
and then seems to wait for ever here:
ioctl(4, USBDEVFS_SETINTERFACE, 0xbfff58a4) = 0
gettimeofday({1227040766, 257390}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfff7024) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [4], NULL, {0, 1000}) = 0 (Timeout)
gettimeofday({1227040766, 257974}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
gettimeofday({1227040766, 261832}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff7068) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
There is a third process, that I can't see its name, in /tmp/ups_trace.5389:
gettimeofday({1227040824, 883850}, NULL) = 0
ioctl(4, USBDEVFS_SUBMITURB, 0xbfff6f84) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff6fc8) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [4], NULL, {0, 1000}) = 0 (Timeout)
gettimeofday({1227040824, 885955}, NULL) = 0
ioctl(4, USBDEVFS_REAPURBNDELAY, 0xbfff6fc8) = -1 EAGAIN (Resource temporarily
unavailable)
select(5, NULL, [], NULL, {0, 1000}) = 0 (Timeout)
But I can't see which file is described by '5'.
I have tried "RUN_AS_USER root" in upsmon.conf to no avail. If I use:
[myups]
# "BELKIN Active Battery Backup"
driver = megatec_usb
port = auto
desc = "Local UPS"
user = root
but the driver complains it does not recognise the "user" option. Currently I have this startup line:
$UPSDRVCTL_BIN -u root start || rc_failed
which is verbose but does not work, either.
I have been pointed to this email:
<http://lists.alioth.debian.org/pipermail/nut-upsuser/2008-February/003753.html>
and it appears that my particular UPS model works with the development version of the software. I will have to try that next.
- -- Cheers,
Carlos E. R.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEARECAAYFAkkjaYUACgkQtTMYHG2NR9UuTgCfbVULsHukBNYW5DD8NmLYLSLr
KLkAoI4keaB1AxflpHjg5cm2mymHf7qO
=XRlM
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
| < Previous | Next > |