<div dir="ltr">Hi Jim,<div><br></div><div>Thanks for your help. I'll respond in the same order as you did:</div><div><ol><li>Unfortunately, I did "chown" stuff to these created users... Since the other three responses don't seem to be what you're looking for (but that's only my uninformed interpretation), I suppose the problem lies here?<br>Is there a number of files/directories that I should "chown" again with user "nut"?<br><br></li><li>```<br>erik@MinipcLG2:/usr/lib/udev/rules.d$ cat /usr/lib/udev/rules.d/62-nut-usbups.rules | grep 051d<br>ATTR{idVendor}=="051d", ATTR{idProduct}=="0000", MODE="664", GROUP="nut"<br>ATTR{idVendor}=="051d", ATTR{idProduct}=="0002", MODE="664", GROUP="nut"<br>ATTR{idVendor}=="051d", ATTR{idProduct}=="0003", MODE="664", GROUP="nut"<br>ATTR{idVendor}=="051d", ATTR{idProduct}=="0004", MODE="664", GROUP="nut"<br>```<br><br></li><li>I believe I commented these away? Are you suggesting I change something?<br><br></li><li>```<br>erik@MinipcLG2:/usr/lib/udev/rules.d$ systemctl status nut-driver@apcupskelder.service<br>● nut-driver@apcupskelder.service - Network UPS Tools - device driver for NUT device 'apcupskelder'<br> Loaded: loaded (/usr/lib/systemd/system/nut-driver@.service; enabled; preset: enabled)<br> Drop-In: /etc/systemd/system/nut-driver@apcupskelder.service.d<br> └─nut-driver-enumerator-generated-checksum.conf, nut-driver-enumerator-generated.conf<br> Active: active (running) since Fri 2024-11-01 01:26:41 CET; 14h ago<br> Main PID: 1141 (usbhid-ups)<br> Tasks: 1 (limit: 9284)<br> Memory: 1.0M (peak: 1.9M)<br> CPU: 43.317s<br> CGroup: /system.slice/system-nut\x2ddriver.slice/nut-driver@apcupskelder.service<br> └─1141 /lib/nut/usbhid-ups -a apcupskelder<br><br>nov 01 01:26:40 MinipcLG2 nut-driver@apcupskelder[1068]: HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting ><br>nov 01 01:26:40 MinipcLG2 nut-driver@apcupskelder[1068]: HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting ><br>nov 01 01:26:40 MinipcLG2 nut-driver@apcupskelder[1068]: Using subdriver: APC HID 0.100<br>nov 01 01:26:40 MinipcLG2 nut-driver@apcupskelder[1068]: Network UPS Tools - Generic HID driver 0.52 (2.8.1)<br>nov 01 01:26:40 MinipcLG2 nut-driver@apcupskelder[1068]: USB communication driver (libusb 1.0) 0.46<br>nov 01 01:26:41 MinipcLG2 usbhid-ups[1141]: Startup successful<br>nov 01 01:26:41 MinipcLG2 usbhid-ups[1141]: upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it<br>nov 01 01:26:41 MinipcLG2 nut-driver@apcupskelder[911]: Network UPS Tools - UPS driver controller 2.8.1<br>nov 01 01:26:41 MinipcLG2 systemd[1]: Started nut-driver@apcupskelder.service - Network UPS Tools - device driver for NUT device 'apcupskelder'.<br>nov 01 01:26:42 MinipcLG2 usbhid-ups[1141]: sock_connect: enabling asynchronous mode (auto)<br>lines 1-22/22 (END)<br>```</li></ol><div>Thanks in advance for your further guidance!</div><div><br></div><div>Kind regards,</div></div><div><br></div><div>Erik</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op vr 1 nov 2024 om 15:42 schreef Jim Klimov <<a href="mailto:jimklimov%2Bnut@gmail.com">jimklimov+nut@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div><br></div><div> I was thinking about what could be going wrong here, and a few ideas pop up:</div><div><br></div><div>1) If you installed NUT from packaging, there should have been no need to add OS groups/users manually. There is a valid use-case for running different daemons under different accounts, as long as they talk over network and access same files or UNIX sockets at best by sharing a group for that, but it does need some careful planning to pull off :)<br></div><div>In the worst case, if you also "chown"ed something to these new accounts, and if no daemon actually runs as those, you've locked out the daemons from some access.<br></div><div><br></div><div>2) Access to USB device filesystem nodes should be governed with udev on that platform, check if you have a file like /usr/lib/udev/rules.d/62-nut-usbups.rules and if it lists USB IDs of your device 051d:0002</div><div><br></div><div>3) Driver options bus, device, busport can depend on topology and enumeration of connected devices; it may be wise to comment them away. Later NUT versions already do not default to offering them in `nut-scanner` output, to minimize run-time surprises.<br></div><div> <br>4) See if you already have a service instance `nut-driver@apcupskelder.service` defined and running, since NUT v2.8.0 <a href="https://github.com/networkupstools/nut/wiki/nut%E2%80%90driver%E2%80%90enumerator-(NDE)" target="_blank">https://github.com/networkupstools/nut/wiki/nut%E2%80%90driver%E2%80%90enumerator-(NDE)</a> could have created it - but the older blogs/videos do not reflect this facility. The "terminating other driver" seems to be a clue in that direction. Maybe that other copy of the driver is what holds the USB port. Also avoid `upsdrvctl` in that case.<br></div><div>Notably, if the driver already runs under that service, and `upsd apcupskelder` returns data - maybe you don't have to do anything.<br></div><div><br></div><div>There might be some other loose threads to pull, but please check these ones first as most likely :)<br><br></div><div>Jim<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 30, 2024 at 11:58 AM Erik De Boeck via Nut-upsuser <<a href="mailto:nut-upsuser@alioth-lists.debian.net" target="_blank">nut-upsuser@alioth-lists.debian.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,<br><br>Yesterday, I bought a UPS for the first time in my life, and was eager to dive into NUT. But not all is working as expected... I saw a similar thread started on 18 October, but it didn't help me. (I also spent a handful of hours searching the web for solutions, and of course read the manual and FAQ - "queequeg".)<br><br>I tried shutting my UPS (APC "Back-UPS BX750MI FW:295202G -302202G") down with `sudo upsdrvctl shutdown`, but no response. Digging around, I found a few things that raised my suspicion, but I can't figure it out...<br><br>I followed this fine gentleman's guide (but tweaked it a bit - I don't know why he uses `master` and `slave` for example?): <a href="https://www.youtube.com/watch?v=vyBP7wpN72c" target="_blank">https://www.youtube.com/watch?v=vyBP7wpN72c</a>.<br>I must add that I created a few users and user groups during installation and configuration, following the documentation. But in the end, I lost oversight, and everything didn't work. So it's entirely possible there's a permissions issue somewhere. But I don't have any idea where...<br><br>Because of the trial-and-error approach, in the `.conf` files (shown below), a lot of stuff is commented out. I assume I can delete it, but I also assume the `#` should be adequate? Anyway, I keep it in the output below for clarity.<br><br>I'll just paste various outputs here, I hope that's a reasonable approach?<br><br>Thanks in advance for anyone's help!<br><br>Kind regards,<br><br>Erik</div><div><br></div><div>PS. I also created a GitHub issue (<a href="https://github.com/networkupstools/nut/issues/2666" target="_blank">https://github.com/networkupstools/nut/issues/2666</a>). Maybe doing that AND mailing this, is not the correct procedure? In that case, I apologize.<br><br><br>```<br>erik@MinipcLG2:/$ sudo upsdrvctl shutdown apcupskelder<br>Network UPS Tools - UPS driver controller 2.8.1<br>Network UPS Tools - Generic HID driver 0.52 (2.8.1)<br>USB communication driver (libusb 1.0) 0.46<br>select with socket: Invalid argument<br>Can't claim USB device [051d:0002]@0/0: Entity not found<br>upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it<br>Driver failed to start (exit status=1)<br>```<br><br>```<br>erik@MinipcLG2:/$ sudo nut-scanner -U<br>Scanning USB bus.<br>[nutdev1]<br> driver = "usbhid-ups"<br> port = "auto"<br> vendorid = "051D"<br> productid = "0002"<br> product = "Back-UPS BX750MI FW:295202G -302202G"<br> serial = "9B2416A22014"<br> vendor = "American Power Conversion"<br> bus = "001"<br> device = "004"<br> busport = "002"<br> ###NOTMATCHED-YET###bcdDevice = "0106"<br>```<br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo usbhid-ups -a apcupskelder<br>sudo: usbhid-ups: opdracht niet gevonden<br>```<br>This seems strange? But after some googling, I found the below alternative - although I would expect it to work without `/lib/nut/`):<br>````<br>erik@MinipcLG2:/$ sudo /lib/nut/usbhid-ups -a apcupskelder<br>Network UPS Tools - Generic HID driver 0.52 (2.8.1)<br>USB communication driver (libusb 1.0) 0.46<br>Duplicate driver instance detected (PID file /run/nut/usbhid-ups-apcupskelder.pid exists)! Terminating other driver!<br><br>Bericht aan allen van root@MinipcLG2 (somewhere) (Wed Oct 30 10:27:32 2024):<br><br>Communications with UPS apcupskelder@localhost lost<br><br><br>Bericht aan allen van root@MinipcLG2 (somewhere) (Wed Oct 30 10:27:32 2024):<br><br>Communications with UPS apcupskelder@localhost lost<br><br>HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x0c<br>HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x22<br>HIDParse: LogMax is less than LogMin. Vendor HID report descriptor may be incorrect; interpreting LogMax -1 as 255 in ReportID: 0x40<br>Using subdriver: APC HID 0.100<br><br>Bericht aan allen van root@MinipcLG2 (somewhere) (Wed Oct 30 10:27:40 2024):<br><br>Communications with UPS apcupskelder@localhost established<br><br><br>Bericht aan allen van root@MinipcLG2 (somewhere) (Wed Oct 30 10:27:48 2024):<br><br>Communications with UPS apcupskelder@localhost lost<br><br><br>Bericht aan allen van root@MinipcLG2 (somewhere) (Wed Oct 30 10:27:56 2024):<br><br>Communications with UPS apcupskelder@localhost established<br>```<br><br>```<br>erik@MinipcLG2:/$ cat /etc/group | grep nut<br>users:x:100:nutuser,nutmon<br>nut:x:130:<br>nutuser:x:1002:<br>nutgroup:x:1003:nutuser<br>nutmon:x:1004:<br>nutmongroep:x:1005:nutmon<br>```<br><br>```<br>erik@MinipcLG2:/$ lsusb<br>Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br>Bus 001 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC<br>Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power Supply<br>Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<br>```<br><br>```<br>erik@MinipcLG2:/$ ls -l /dev/bus/usb/001/004<br>crw-rw-r-- 1 root nut 189, 3 okt 30 10:31 /dev/bus/usb/001/004<br>```<br><br>```<br>erik@MinipcLG2:/$ cat /etc/os-release<br>NAME="Linux Mint"<br>VERSION="22 (Wilma)"<br>ID=linuxmint<br>ID_LIKE="ubuntu debian"<br>PRETTY_NAME="Linux Mint 22"<br>VERSION_ID="22"<br>HOME_URL="<a href="https://www.linuxmint.com/" target="_blank">https://www.linuxmint.com/</a>"<br>SUPPORT_URL="<a href="https://forums.linuxmint.com/" target="_blank">https://forums.linuxmint.com/</a>"<br>BUG_REPORT_URL="<a href="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/" target="_blank">http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/</a>"<br>PRIVACY_POLICY_URL="<a href="https://www.linuxmint.com/" target="_blank">https://www.linuxmint.com/</a>"<br>VERSION_CODENAME=wilma<br>UBUNTU_CODENAME=noble<br>```<br><br>```<br>erik@MinipcLG2:/$ hostnamectl<br> Static hostname: MinipcLG2<br> Icon name: computer-desktop<br> Chassis: desktop 🖥️<br> Machine ID: xxxxxxxxxxxxxxxxxxxxxxxxx<br> Boot ID:
xxxxxxxxxxxxxxxxxxxxxxxxx<br>Operating System: Linux Mint 22<br> Kernel: Linux 6.8.0-47-generic<br> Architecture: x86-64<br> Hardware Vendor: HP<br> Hardware Model: HP EliteDesk 800 G2 DM 65W<br>Firmware Version: N21 Ver. 02.10<br> Firmware Date: Sun 2016-01-24<br> Firmware Age: 8y 9month 6d<br>```<br><br>```<br>erik@MinipcLG2:/$ uname -r<br>6.8.0-47-generic<br>```<br><br>```<br>erik@MinipcLG2:/$ sudo apt list nut*<br>Bezig met oplijsten... Klaar<br>nut-cgi/noble,now 2.8.1-3.1ubuntu2 amd64 [geïnstalleerd]<br>nut-client/noble,now 2.8.1-3.1ubuntu2 amd64 [geïnstalleerd]<br>nut-doc/noble 2.8.1-3.1ubuntu2 all<br>nut-i2c/noble 2.8.1-3.1ubuntu2 amd64<br>nut-ipmi/noble 2.8.1-3.1ubuntu2 amd64<br>nut-modbus/noble 2.8.1-3.1ubuntu2 amd64<br>nut-monitor/noble 2.8.1-3.1ubuntu2 all<br>nut-powerman-pdu/noble 2.8.1-3.1ubuntu2 amd64<br>nut-server/noble,now 2.8.1-3.1ubuntu2 amd64 [geïnstalleerd]<br>nut-snmp/noble 2.8.1-3.1ubuntu2 amd64<br>nut-xml/noble 2.8.1-3.1ubuntu2 amd64<br>nut/noble,now 2.8.1-3.1ubuntu2 all [geïnstalleerd]<br>nutcracker/noble 0.5.0+dfsg-2 amd64<br>nutsqlite/noble 2.0.6-4 all<br>nuttcp/noble 6.1.2-4build1 amd64<br>```<br><br>```<br>erik@MinipcLG2:/$ sudo /lib/nut/usbhid-ups -DDD -a apcupskelder<br>Network UPS Tools - Generic HID driver 0.52 (2.8.1)<br>USB communication driver (libusb 1.0) 0.46<br> 0.000000 [D3] do_global_args: var='pollinterval' val='1'<br> 0.000024 [D1] testval_reloadable: setting 'pollinterval' exists and differs: new value '1' vs. '2'<br> 0.000057 [D3] do_global_args: var='maxretry' val='3'<br> 0.000083 [D3] main_arg: var='driver' val='usbhid-ups'<br> 0.000108 [D3] main_arg: var='port' val='auto'<br> 0.000136 [D3] main_arg: var='desc' val='Back-UPS BX750MI FW:295202G -302202G'<br> 0.000152 [D3] main_arg: var='vendorid' val='051d'<br> 0.000179 [D3] main_arg: var='productid' val='0002'<br> 0.000203 [D3] main_arg: var='serial' val='9B2416A22014'<br> 0.000248 [D1] Network UPS Tools version 2.8.1 (release/snapshot of 2.8.1) built with gcc (Ubuntu 13.2.0-23ubuntu2) 13.2.0 and configured with flags: --build=x86_64-linux-gnu --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --prefix= --sysconfdir=/etc/nut --includedir=/usr/include --mandir=/usr/share/man --libdir=${prefix}/lib/x86_64-linux-gnu --libexecdir=/usr/libexec --with-ssl --with-nss --with-cgi --with-dev --enable-static --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-pkgconfig-dir=/usr/lib/x86_64-linux-gnu/pkgconfig --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-python=python3 --with-python3=/usr/bin/python3 --with-doc=man,html-single,html-chunked,pdf<br> 0.000352 [D1] debug level is '3'<br> 0.002200 [D1] Succeeded to become_user(nut): now UID=121 GID=130<br> 0.002266 [D1] upsdrv_initups (non-SHUT)...<br> 0.002285 [D2] Initializing an USB-connected UPS with library libusb-1.0.27 (API: 0x100010a) (NUT subdriver name='USB communication driver (libusb 1.0)' ver='0.46')<br> 0.008020 [D2] Checking device 1 of 4 (1D6B/0003)<br> 0.008045 [D1] Failed to open device (1D6B/0003), skipping: Access denied (insufficient permissions)<br> 0.008052 [D2] Checking device 2 of 4 (0403/6001)<br> 0.008064 [D1] Failed to open device (0403/6001), skipping: Access denied (insufficient permissions)<br> 0.008079 [D2] Checking device 3 of 4 (051D/0002)<br> 0.010003 [D2] - VendorID: 051d<br> 0.010014 [D2] - ProductID: 0002<br> 0.010018 [D2] - Manufacturer: American Power Conversion<br> 0.010022 [D2] - Product: Back-UPS BX750MI FW:295202G -302202G<br> 0.010026 [D2] - Serial Number: 9B2416A22014<br> 0.010030 [D2] - Bus: 001<br> 0.010034 [D2] - Bus Port: 002<br> 0.010038 [D2] - Device: 004<br> 0.010042 [D2] - Device release number: 0106<br> 0.010046 [D2] Trying to match device<br> 0.010058 [D2] match_function_subdriver (non-SHUT mode): matching a device...<br> 0.010068 [D3] match_function_regex: matching a device...<br> 0.010145 [D2] Device matches<br> 0.010155 [D2] Reading first configuration descriptor<br> 0.010172 [D3] libusb_kernel_driver_active() returned 0: Success<br> 0.010186 [D2] failed to claim USB device: Resource busy<br> 0.010198 [D2] Kernel driver already detached<br> 0.010210 [D2] failed to claim USB device: Resource busy<br> 0.010225 [D2] Kernel driver already detached<br> 0.010237 [D2] failed to claim USB device: Resource busy<br> 0.010249 [D2] Kernel driver already detached<br> 0.010263 [D2] failed to claim USB device: Resource busy<br> 0.010275 [D2] Kernel driver already detached<br> 0.010286 Can't claim USB device [051d:0002]@0/0: Entity not found<br> 0.010300 upsnotify: failed to notify about state 4: no notification tech defined, will not spam more about it<br>```<br><br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo cat /etc/nut/hosts.conf<br>MONITOR apcupskelder@localhost "APC-UPS kelder"<br>```<br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo cat /etc/nut/nut.conf<br>MODE=netserver<br>```<br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo cat /etc/nut/ups.conf<br>pollinterval = 1<br>maxretry = 3<br><br><br>[apcupskelder]<br> driver = usbhid-ups<br> port = auto<br> desc = "Back-UPS BX750MI FW:295202G -302202G"<br> vendorid = 051d<br> productid = 0002<br> serial = 9B2416A22014<br># vendor = "American Power Conversion"<br># bus = 001<br># device = 005<br># busport = 002<br> ###NOTMATCHED-YET###bcdDevice = "0106"<br>```<br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo cat /etc/nut/upsd.conf<br>LISTEN 0.0.0.0 3493<br>```<br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo cat /etc/nut/upsd.users<br>#[bespieder]<br>[monuser]<br> password = indUStr*a<br># bekijker primary<br># admin master<br> admin primary<br>```<br><br>```<br>erik@MinipcLG2:/etc/nut$ sudo cat /etc/nut/upsmon.conf<br>#RUN_AS_USER nutgebruiker<br>RUN_AS_USER root<br>#MONITOR apcupskelder@localhost 1 bekijker indUStr*a primary<br>#MONITOR apcupskelder@localhost 1 admin indUStr*a master<br>MONITOR apcupskelder@localhost 1 admin indUStr*a primary<br><br><br>MINSUPPLIES 1<br>SHUTDOWNCMD "/sbin/shutdown -h +0"<br>NOTIFYCMD /usr/sbin/upssched<br>POLLFREQ 2<br>POLLFREQALERT 1<br>HOSTSYNC 15<br>DEADTIME 15<br>POWERDOWNFLAG /etc/nut/killpower<br><br>NOTIFYMSG ONLINE "UPS %s on line power"<br>NOTIFYMSG ONBATT "UPS %s on battery"<br>NOTIFYMSG LOWBATT "UPS %s battery is low"<br>NOTIFYMSG FSD "UPS %s: forced shutdown in progress"<br>NOTIFYMSG COMMOK "Communications with UPS %s established"<br>NOTIFYMSG COMMBAD "Communications with UPS %s lost"<br>NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"<br>NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"<br>NOTIFYMSG NOCOMM "UPS %s is unavailable"<br>NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"<br><br>NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC<br>NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC<br>NOTIFYFLAG LOWBATT SYSLOG+WALL<br>NOTIFYFLAG FSD SYSLOG+WALL+EXEC<br>NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC<br>NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC<br>NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC<br>NOTIFYFLAG REPLBATT SYSLOG+WALL<br>NOTIFYFLAG NOCOMM SYSLOG+WALL+EXEC<br>NOTIFYFLAG NOPARENT SYSLOG+WALL<br><br>RBWARNTIME 43200<br><br>NOCOMMWARNTIME 600<br><br>FINALDELAY 5<br>```</div></div>
_______________________________________________<br>
Nut-upsuser mailing list<br>
<a href="mailto:Nut-upsuser@alioth-lists.debian.net" target="_blank">Nut-upsuser@alioth-lists.debian.net</a><br>
<a href="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser" rel="noreferrer" target="_blank">https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser</a><br>
</blockquote></div>
</blockquote></div>