Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 456086 - sys-power/nut-2.6.5: nut-scanner cannot find libusb:0 runtime
Summary: sys-power/nut-2.6.5: nut-scanner cannot find libusb:0 runtime
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-07 20:16 UTC by Eriks Latosheks
Modified: 2013-08-12 06:46 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eriks Latosheks 2013-02-07 20:16:52 UTC
nut-scanner from nut package tries to load dynamically /lib/libusb.so which is not available on Gentoo libusb:0.


Reproducible: Always

Steps to Reproduce:
1. emerge nut-2.6.5
2. run 
# nut-scanner -U

Actual Results:  
nut-scanner reports
> Cannot load USB library (libusb) : file not found. USB search disabled.


Expected Results:  
nut-scanner -U should successfully scan UPS USB devices.

It seems that either libusb:0 does not provide proper symlinks or nut-2.6.5 is not  localized for Gentoo (x64) layout. When running nut-scanner under strace it seems that utility mostly scans for /lib/libusb* files while libusb:0 only provides /lib64/libusb* stuff.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-02-09 15:37:13 UTC
carnivoor ~ # nut-scanner 
Cannot load USB library (libusb) : file not found. USB search disabled.
No start IP, skipping SNMP
No start IP, skipping NUT bus (old connect method)
Segmentation fault
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2013-08-12 06:46:58 UTC
I can't reproduce this:

# strace -ff nut-scanner   2>&1 |grep libusb
open("/lib/libusb.la", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/usr/lib/libusb.la", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/lib64/libusb.la", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/lib64/libusb.la", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/usr/local/lib64/libusb.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib32/libusb.la", O_RDONLY)      = -1 ENOENT (No such file or directory)
open("/usr/lib32/libusb.la", O_RDONLY)  = -1 ENOENT (No such file or directory)
open("/usr/local/lib32/libusb.la", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libusb.la", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("/usr/lib/libusb.la", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libusb.la", O_RDONLY) = -1 ENOENT (No such file or directory)
...
access("/lib/libusb.so", R_OK)          = -1 ENOENT (No such file or directory)
access("/usr/lib/libusb.so", R_OK)      = 0
open("/usr/lib/libusb.so", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib64/libusb-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3

Also, as in my case /usr/lib is a symlink to /usr/lib64, I removed the symlink, and I confirm it DOES check both locations:
access("/lib/libusb.so", R_OK)          = -1 ENOENT (No such file or directory)
access("/usr/lib/libusb.so", R_OK)      = -1 ENOENT (No such file or directory)
access("/lib64/libusb.so", R_OK)        = -1 ENOENT (No such file or directory)
access("/usr/lib64/libusb.so", R_OK)    = -1 ENOENT (No such file or directory)
access("/usr/local/lib64/libusb.so", R_OK) = -1 ENOENT (No such file or directory)
access("/lib32/libusb.so", R_OK)        = -1 ENOENT (No such file or directory)