[Nut-upsuser] Help with CGI upsstats.cgi giving "file not found"

Charles Lepple clepple at gmail.com
Thu Dec 21 12:24:28 GMT 2023


On Dec 20, 2023, at 5:17 PM, Tim Reimers KA4LFP via Nut-upsuser wrote:
> 
> First, a summary:
> - I have a RasPI  (hereafter referred to as Pi1)  running Bullseye in which this all WORKS FINE -- the upsd/upsc/ monitor services, etc
> - I have a SECOND RasPI (hereafter referred to as Pi2) running Bullseye in which ONLY the CGI scripts do not work. 
> All other (upsc/upsd/systemctl) show normal status and work to retrieve data from the single UPS attached to each Pi.
> 
I'm not quite sure what is missing[*], but when you get no output from a program, and a "file not found" error from bash, it is usually a missing shared library that prevents the executable from fully loading.

[*] the confusing part is that the other NUT command line tools aren't affected.

Was the CGI program installed from the Debian nut-cgi package? Or was it built from source, or copied from the other Pi?

You should get output similar to this from ldd (this is from an amd64 Ubuntu system, so details may differ, but consider overall structure):

$ ldd /usr/lib/cgi-bin/nut/upsstats.cgi 
linux-vdso.so.1 (0x00007fff1a99b000)
libupsclient.so.4 => /lib/x86_64-linux-gnu/libupsclient.so.4 (0x00007eff6ebec000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007eff6ebc9000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007eff6e9d7000)
libnss3.so => /usr/lib/x86_64-linux-gnu/libnss3.so (0x00007eff6e888000)
libssl3.so => /usr/lib/x86_64-linux-gnu/libssl3.so (0x00007eff6e829000)
libplds4.so => /usr/lib/x86_64-linux-gnu/libplds4.so (0x00007eff6e824000)
libplc4.so => /usr/lib/x86_64-linux-gnu/libplc4.so (0x00007eff6e81b000)
libnspr4.so => /usr/lib/x86_64-linux-gnu/libnspr4.so (0x00007eff6e7db000)
/lib64/ld-linux-x86-64.so.2 (0x00007eff6ec29000)
libnssutil3.so => /usr/lib/x86_64-linux-gnu/libnssutil3.so (0x00007eff6e7a8000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007eff6e7a2000)

If any of the libraries don't have a path after "=>", that's something to investigate on the working Pi (e.g. "dpkg --search libnss3.so <http://libnss3.so/>" to see which package provides that library)

- Charles


More information about the Nut-upsuser mailing list