Closed MarvinMynx closed 1 year ago
Odd, just realized that debian/rules
does specify --prefix=
(empty) and so --libdir=\${prefix}/lib/$(DEB_HOST_MULTIARCH)
would resolve to /lib/...
indeed.
Other than that, I tried to reproduce your situation with a freshly installed Proxmox 7.3-1 into a VM, with disabled "enterprise" repo I don't have access to:
root@pve:~# uname -a
Linux pve 5.15.74-1-pve #1 SMP PVE 5.15.74-1 (Mon, 14 Nov 2022 20:17:15 +0100) x86_64 GNU/Linux
root@pve:~# mv /etc/apt/sources.list.d/pve-enterprise.list{,.bak}
And added these packages following your posts above, which are a subset of suggestions in config-prereq.txt
:
:; apt-get update
:; apt-get install ccache time git python perl curl make autoconf automake \
libltdl-dev libtool-bin libtool valgrind cppcheck pkg-config gcc g++ clang \
python3 python3.9 aspell-en asciidoc source-highlight python3-pygments dblatex \
libgd-dev libsystemd-dev libcppunit-dev libssl-dev libnss3-dev augeas-tools \
libaugeas-dev augeas-lenses libusb-dev libusb-1.0-0-dev libi2c-dev libmodbus-dev \
libsnmp-dev
libsn
so not sure if any more packages followed (that section in the document included further libpowerman0-dev libfreeipmi-dev libipmimonitoring-dev libavahi-common-dev libavahi-core-dev libavahi-client-dev
).Then I added
:; apt-get install lua5.1-dev bash dash ksh busybox # libneon27-dev
from your subsequent post. With their current offering, neither version of libneon27-dev
or libneon27-gnutls-dev
was installable due to conflict between available versions of comerr-dev
/libcom-err2
which they pull in.
Finally I added a non-root user and ran the build+check command from your recent post (note: before installing any NUT packages for the first shot):
git clone https://github.com/networkupstools/nut
cd nut
./autogen.sh
./configure --enable-inplace-runtime --prefix= \
--sysconfdir=/etc/nut \
--includedir=/usr/include \
--mandir=/usr/share/man \
--libexecdir=/usr/libexec \
--with-statepath=/run/nut \
--with-altpidpath=/run/nut \
--with-drvpath=/lib/nut \
--with-cgipath=/usr/lib/cgi-bin/nut \
--with-htmlpath=/usr/share/nut/www \
--with-pidpath=/run/nut \
--datadir=/usr/share/nut \
--with-user=nut --with-group=nut \
--with-udev-dir=/lib/udev \
--with-systemdsystemunitdir=/lib/systemd/system \
--with-systemdshutdowndir=/lib/systemd/system-shutdown \
--with-systemdtmpfilesdir=/usr/lib/tmpfiles.d \
--with-ssl \
--with-cgi \
--with-pkgconfig-dir=/usr/lib/x86_64-linux-gnu/pkgconfig \
--libdir=/usr/lib/x86_64-linux-gnu
make -j 4 all check
...which gave this configuration:
NUT Configuration summary:
==========================
* configured version: 2.8.0.1 (v2.8.0-Windows-568-gf813c1404)
* build serial drivers: yes
* build USB drivers: yes (libusb-1.0)
* build neon based XML driver: no
* enable Avahi support: no
* build Powerman PDU client driver: no
* build Modbus driver: yes
* build IPMI driver: no
* build Mac OS X meta-driver: no
* build i2c based drivers: yes
* enable SSL support: yes (OpenSSL)
* enable libwrap (tcp-wrappers) support: yes
* enable libltdl (Libtool dlopen abstraction) support: yes
* build nut-scanner: yes
* build CGI programs: yes
* install NUT-Monitor desktop application: no
* install PyNUT binding module: yes
* use default Python interpreter: /usr/bin/python
* use specific Python2 interpreter: /usr/bin/python2.7
* use specific Python3 interpreter: /usr/bin/python3
* build and install documentation: man=auto
* build specific documentation format(s): yes man
* build and install the development files: no
* consider basic SMF support: no
* consider basic systemd support: yes
* build with tighter systemd support: yes
* build C++11 codebase (client library, etc.): yes
* build C++ tests with CPPUNIT: yes
* build SNMP drivers: yes
* build SNMP drivers with statically linked lib(net)snmp: no
* User to run as: nut
* Group of user to run as: nut
NUT Paths:
----------
* Default installation prefix path:
* State file path: /run/nut
* Unprivileged PID file path: /run/nut
* Privileged PID file path: /run/nut
* Driver program path: /lib/nut
* CGI program path: /usr/lib/cgi-bin/nut
* HTML file path: /usr/share/nut/www
* Config file path: /etc/nut
* Data file path: /usr/share/nut
* Tool program path: /bin
* System program path: /sbin
* System library path: /usr/lib/x86_64-linux-gnu
* System exec-library path: /usr/libexec
NUT Paths for third-party integrations:
---------------------------------------
* Default Python interpreter site-packages: /usr/local/lib/python2.7/dist-packages
* Specific Python2 interpreter site-packages: /usr/local/lib/python2.7/dist-packages
* Specific Python3 interpreter site-packages: /usr/local/lib/python3.9/dist-packages
* pkg-config *.pc directory: /usr/lib/x86_64-linux-gnu/pkgconfig => /usr/lib/x86_64-linux-gnu/pkgconfig
* Service units for systemd: /lib/systemd/system
* Shutdown hooks for systemd: /lib/systemd/system-shutdown
* Systemd-tmpfiles configs: /usr/lib/tmpfiles.d
* Augeas lenses directory: /usr/share/augeas/lenses/dist
* Udev rules directory: /lib/udev
NUT Build/Target system info:
-----------------------------
* Compact version of C compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110
* Compact version of C++ compiler: g++ (Debian 10.2.1-6) 10.2.1 20210110
* Compact version of C preprocessor: gcc (Debian 10.2.1-6) 10.2.1 20210110
* host env spec we run on: x86_64-pc-linux-gnu
* host env spec we built on: x86_64-pc-linux-gnu
* host env spec we built for: x86_64-pc-linux-gnu
* host OS short spec we run on: x86_64-linux-gnu
* host OS short spec we built on: x86_64-linux-gnu
* host OS short spec we built for: x86_64-linux-gnu
NUT Compiler settings:
----------------------
* CC : gcc
* CFLAGS : -isystem /usr/local/include -g -O2 -Wno-reserved-identifier -Wno-unknown-warning-option -std=gnu99 -Wno-system-headers -Wall -Wextra -Wsign-compare -pedantic -Wno-error
* CXX : g++
* CXXFLAGS : -isystem /usr/local/include -g -O2 -Wno-reserved-identifier -Wno-unknown-warning-option -std=gnu++11 -Wno-system-headers -Wall -Wextra -Wno-error
* CPP : gcc -E
* CPPFLAGS :
* CONFIG_FLAGS : --prefix= --sysconfdir=/etc/nut --includedir=/usr/include --mandir=/usr/share/man --libexecdir=/usr/libexec --with-statepath=/run/nut --with-altpidpath=/run/nut --with-drvpath=/lib/nut --with-cgipath=/usr/lib/cgi-bin/nut --with-htmlpath=/usr/share/nut/www --with-pidpath=/run/nut --datadir=/usr/share/nut --with-user=nut --with-group=nut --with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system --with-systemdshutdowndir=/lib/systemd/system-shutdown --with-systemdtmpfilesdir=/usr/lib/tmpfiles.d --with-ssl --with-cgi --with-pkgconfig-dir=/usr/lib/x86_64-linux-gnu/pkgconfig --libdir=/usr/lib/x86_64-linux-gnu --enable-inplace-runtime
...and "sort of" succeeded: no complaints posted in the end of log (gotta check the wall of text in more detail), but indeed make finished after all
and with an exit-code 2 (Ctrl+C equivalent), without running the check
part. Re-running the same make -j 4 all check
line got it to check things. I suspect some issue either with the version of make
which Proxmox (or Debian proper) ships, possibly with GNU Make itself (can't reproduce with BSD and Sun makes, for example), or autotools version that generates the makefiles, or potentially with our Makefile.am interactions (maybe some dependency needed for check
to be scheduled properly either got broken with some recent iterations, and/or two copies of parallel make
try to build and shuffle same files for two goals).
Either way, just running make -j 4 all
succeeds, as does subsequent make -j 4 check
. So for the time being, amend that part to make -j 4 all && make -j 4 check
and I'll investigate the multi-goal behavior on Linux+GNUmake when I have time. I think CI builds each major target separately so such mis-behavior was not noticed anywhere before.
Now, trying to install NUT packages (I am not sure if you pulled the nut
umbrella only, or additional packages, or just some of the core ones) to configure an "in-place" build later. Output of their packaging looks quirky out of the box:
:; apt-get install nut
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
freeipmi-common libavahi-core7 libdbus-1-dev libfreeipmi17 libipmimonitoring6 libpowerman0
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libnutscan1 libupsclient4 nut-client nut-server
Suggested packages:
nut-monitor nut-cgi nut-ipmi nut-snmp nut-xml
The following NEW packages will be installed:
libnutscan1 libupsclient4 nut nut-client nut-server
0 upgraded, 5 newly installed, 0 to remove and 23 not upgraded.
Need to get 1,759 kB of archives.
After this operation, 6,803 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.cz.debian.org/debian bullseye/main amd64 libupsclient4 amd64 2.7.4-13 [186 kB]
Get:2 http://ftp.cz.debian.org/debian bullseye/main amd64 nut-client amd64 2.7.4-13 [252 kB]
Get:3 http://ftp.cz.debian.org/debian bullseye/main amd64 libnutscan1 amd64 2.7.4-13 [192 kB]
Get:4 http://ftp.cz.debian.org/debian bullseye/main amd64 nut-server amd64 2.7.4-13 [881 kB]
Get:5 http://ftp.cz.debian.org/debian bullseye/main amd64 nut all 2.7.4-13 [247 kB]
Fetched 1,759 kB in 6s (283 kB/s)
Selecting previously unselected package libupsclient4:amd64.
(Reading database ... 121121 files and directories currently installed.)
Preparing to unpack .../libupsclient4_2.7.4-13_amd64.deb ...
Unpacking libupsclient4:amd64 (2.7.4-13) ...
Selecting previously unselected package nut-client.
Preparing to unpack .../nut-client_2.7.4-13_amd64.deb ...
Unpacking nut-client (2.7.4-13) ...
Selecting previously unselected package libnutscan1:amd64.
Preparing to unpack .../libnutscan1_2.7.4-13_amd64.deb ...
Unpacking libnutscan1:amd64 (2.7.4-13) ...
Selecting previously unselected package nut-server.
Preparing to unpack .../nut-server_2.7.4-13_amd64.deb ...
Unpacking nut-server (2.7.4-13) ...
Selecting previously unselected package nut.
Preparing to unpack .../archives/nut_2.7.4-13_all.deb ...
Unpacking nut (2.7.4-13) ...
Setting up libnutscan1:amd64 (2.7.4-13) ...
Setting up libupsclient4:amd64 (2.7.4-13) ...
Setting up nut-client (2.7.4-13) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nut-monitor.service → /lib/systemd/system/nut-monitor.service.
Job for nut-monitor.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status nut-monitor.service" and "journalctl -xe" for details.
Setting up nut-server (2.7.4-13) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nut-server.service → /lib/systemd/system/nut-server.service.
nut-driver.service is a disabled or a static unit, not starting it.
Setting up nut (2.7.4-13) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u5) ...
They suggest a nut-monitor
package which does not exist: the nut-client
takes its place to deliver the nut-monitor
service for upsmon
, which failed due to lack of configuration (kinda expected out of the box), so lots of scary letters validly:
...
Setting up nut-client (2.7.4-13) ...
Created symlink /etc/systemd/system/multi-user.target.wants/nut-monitor.service → /lib/systemd/system/nut-monitor.service.
Job for nut-monitor.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status nut-monitor.service" and "journalctl -xe" for details.
...
:; systemctl status nut-monitor.service
* nut-monitor.service - Network UPS Tools - power device monitor and shutdown controller
Loaded: loaded (/lib/systemd/system/nut-monitor.service; enabled; vendor preset: enabled)
Active: failed (Result: protocol) since Mon 2023-02-27 01:02:46 CET; 2min 30s ago
CPU: 849us
Feb 27 01:02:46 pve systemd[1]: Starting Network UPS Tools - power device monitor and shutdown controller...
Feb 27 01:02:46 pve upsmon[160966]: upsmon disabled, please adjust the configuration to your needs
Feb 27 01:02:46 pve upsmon[160966]: Then set MODE to a suitable value in /etc/nut/nut.conf to enable it
Feb 27 01:02:46 pve systemd[1]: nut-monitor.service: Can't open PID file /run/nut/upsmon.pid (yet?) after start: Operation not permitted
Feb 27 01:02:46 pve systemd[1]: nut-monitor.service: Failed with result 'protocol'.
Feb 27 01:02:46 pve systemd[1]: Failed to start Network UPS Tools - power device monitor and shutdown controller.
Results of make clean ; ./configure --enable-inplace-runtime
on this system were indeed weird, and different for root and unprivileged users, so indeed I have homework to tend to.
(I am not sure if you pulled the
nut
umbrella only, or additional packages, or just some of the core ones)
I've installed nut with the Following two Lines:
apt install nut nut-client nut-server
apt install apache2 nut-cgi
docs for "pollonly"
See usbhid-ups manpage, e.g. https://github.com/networkupstools/nut/blob/master/docs/man/usbhid-ups.txt It is just a flag setting (nothing to equate to) in an
ups.conf
section for the device, e.g.[ups] driver = usbhid-ups port = auto pollonly # other options
I'm trying this now.
But this seems to Work out. Since I added this to my Config, I didn't see Data Stale or any Relevant Errors so far anymore.
Sounds promising! And that's with 2.7.4 remaining the installed version?
Sounds promising! And that's with 2.7.4 remaining the installed version?
yes.
Regarding in-place builds, I hope PR #1865 will fix the deficiencies found while investigating this thread - thanks for bringing that up.
No Problem :)
Can this ticket be closed then - as far as the original scope was to monitor more reliably with what NUT you have deployed, it is achieved by pollonly
?
Ideas to build a newer NUT that may be even more resilient became a new and separate issue of sorts, and ultimately not an unavoidable and required step to solution "here and now"?
Yes, this Ticket can be Closed. Thank you very much, for all your Support.
PowerWalker VI 2200 SHL OS: Proxmox - Debian GNU/Linux 11 (bullseye)
upsd -v
uname -a
I have a problem with my UPS. After some time, it sort of Disconnects and as a result the Driver times out or something. I don't quite understand the Problem. It's my first time debugging/configuring a USB Device / UPS. I have many Config Files and Log Messages that hopefully describe the Problem better than I can. And I have made some Screenshots from the Last time this happened Today. (This happens Multiple Times a Day)
First Image: DATA STALE
Second Image: Reconnect to Temporarily get Rid of the Error
lsusb | grep -i ups
upsc powerwalker
upscmd -l powerwalker
upsrw powerwalker
usbhid-dump -a 001:006
/lib/nut/usbhid-ups -DD -a powerwalker
cat /etc/nut/hosts.conf
cat /etc/nut/nut.conf
cat /etc/nut/ups.conf
cat /etc/nut/upsd.conf
cat /etc/nut/upsd.users
cat /etc/nut/upsmon.conf
cat /etc/nut/upssched.conf
cat /etc/nut/upssched-cmd
I needed this udev Rule because otherwise the Server would not Boot up and dmesg would be full of USB Reconnects every 10 Seconds.
cat /etc/udev/rules.d/99-nut-ups.rule
I hope someone can help me diagnose this problem so I can use my UPS reliably.