[Nut-upsuser] MGE Evolution, USB and linux

Rodrigo Ventura
2006-06-07T11:46:33Z

Let me add the following to my previous email: a strace of upsdrvctl

# strace -ff /usr/local/nutups/bin/upsdrvctl start
execve("/usr/local/nutups/bin/upsdrvctl",
["/usr/local/nutups/bin/upsdrvctl", "start"], [/* 34 vars
*/]) = 0
[...]
[pid  7422] open("/proc/bus/usb/001/002", O_RDONLY) = 5
[pid  7422] read(5, "\22\1\20\1\0\0\0\10c\4\377\377\0\1\4\2102\1", 18)
= 18
[pid  7422] read(5, "\t\2\"\0\1\1\0\340", 8) = 8
[pid  7422] read(5,
"\24\t\4\0\0\1\3\0\0\0\t!\0\1!\1\"T\6\7\5\201\3\10\0\24"..., 26)
= 26
[pid  7422] close(5)                    = 0
[pid  7422] getdents64(4, /* 0 entries */, 4096) = 0
[pid  7422] close(4)                    = 0
[pid  7422] open("/proc/bus/usb/001/001", O_RDWR) = -1 EACCES
(Permission denied)
[pid  7422] open("/proc/bus/usb/001/001", O_RDONLY) = 4
[pid  7422] ioctl(4, USBDEVFS_CONTROL, 0xbfffc550) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CONTROL, 0xbfffc550) = -1 EPERM (Operation not
permitted)
[pid  7422] close(4)                    = 0
[pid  7422] open("/proc/bus/usb/001/002", O_RDWR) = -1 EACCES
(Permission denied)
[pid  7422] open("/proc/bus/usb/001/002", O_RDONLY) = 4
[pid  7422] ioctl(4, USBDEVFS_CONTROL, 0xbfffc550) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CONTROL, 0xbfffc550) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CONTROL, 0xbfffc550) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfffc6f4) = -1 EPERM (Operation
not permitted)
[pid  7422] ioctl(4, USBDEVFS_IOCTL, 0xbfffc6d0) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfffc6f4) = -1 EPERM (Operation
not permitted)
[pid  7422] ioctl(4, USBDEVFS_IOCTL, 0xbfffc6d0) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfffc6f4) = -1 EPERM (Operation
not permitted)
[pid  7422] ioctl(4, USBDEVFS_IOCTL, 0xbfffc6d0) = -1 EPERM (Operation not
permitted)
[pid  7422] ioctl(4, USBDEVFS_CLAIMINTERFACE, 0xbfffc6f4) = -1 EPERM (Operation
not permitted)
[pid  7422] ioctl(4, USBDEVFS_CONTROL, 0xbfffc6c0) = -1 EPERM (Operation not
permitted)
[pid  7422] close(4)                    = 0
[pid  7422] write(2, "No matching USB/HID UPS found\n", 30No matching
USB/HID UPS found
) = 30
[...]

Seems the driver has no R/W permission, probably because of a change
of UID of the driver.

# ls -laF /proc/bus/usb/001/
total 0
dr-xr-xr-x    1 root     root            0 Jun  7 11:07 ./
dr-xr-xr-x    1 root     root            0 Jun  7 11:07 ../
-rw-r--r--    1 root     root           18 Jun  7 11:07 001
-rw-r--r--    1 root     root           18 Jun  7 11:07 002

Since this is a usbdevfs, how can I make this read/writable by nutups user?

Cheers,

Rodrigo Ventura