Nut addon usb stopped working

nut usb support fails

$ nut-scanner
! Cannot load USB library (libusb-1.0.so) : file not found. USB search disabled.

Fix

$ ln -s /usr/lib/libusb-1.0.so.0 /usr/lib/libusb-1.0.so

Likely happened since IPFire 2.27 - Core Update 173 with libusb 1.0.26 change.

I have checked the libusb lib files and they have been the same from at least CU170 to current date.

libusb-1.0.so.0.2.0 was updated to libusb-1.0.so.0.3.0, the current lib, in Jan 2022 with the update to libusb-1.0.24 and has not changed since then.

Okay, after a bit of investigating.

Normally with the packages in IPFire the libname-x.y.so is not installed and linked to anything.
That has been the case with nut since it was originally installed.

I have installed nut on my vm testbed system and ran nut-scanner and got the following response.

Cannot load USB library (libusb-1.0.so) : file not found. USB search disabled.
Cannot load SNMP library (libnetsnmp.so) : file not found. SNMP search disabled.
Cannot load AVAHI library (libavahi-client.so) : file not found. AVAHI search disabled.
Cannot load NUT library (libupsclient.so) : file not found. NUT search disabled.
No start IP, skipping NUT bus (old connect method)
Scanning NUT simulation devices.

nut is not looking for the .so.x and .so.x.y.z libraries but the actual .so file itself.

As these have always been commented out it means that this issue has been there with nut since its original installation.

I will have to discuss this with the devs. We can of course uncomment these .so entries but we then need to ensure that in a year or so someone does not see that there are uncommented .so entries and “correct” this.

Just such an update was done by me when updating nut from 2.7.4 to 2.8.0, two years ago, where I noticed the .so files and commented them out.

I will have to look at changing the commented nut .so files back to uncommented.

I will also discuss with the devs about uncommenting the libusb.so library file and how we ensure that these aren’t accidentally commented out again in the future. Not sure how to do that?

Found an issue in the nut github repo. Apparently this is a problem with nut expecting development files (which includes .so files) to be present.

This apparently used to be a problem also in versions before 2.7.4
It was fixed in 2.7.4 but somewhere between that version and 2.8.2 a regression occurred because the same issue has now been raised.

nut have committed a fix for this issue and it will be in version 2.8.3

When that version is released then I will submit a patch for it. That way IPFire can stay with by default not using the development .so files.

3 Likes

Thanks for the update Adolf. Yes, seems to be the best approach to get it fixed at its source.