Summary: | перестал работать после обновления с p10 на p11 | ||
---|---|---|---|
Product: | Branch p11 | Reporter: | Denis G. Samsonenko <d.g.samsonenko> |
Component: | nut-server | Assignee: | qa-team <qa-team> |
Status: | UNCONFIRMED --- | QA Contact: | qa-p11 <qa-p11> |
Severity: | normal | ||
Priority: | P5 | CC: | d.g.samsonenko, hobbyte, vsu |
Version: | unspecified | ||
Hardware: | x86_64 | ||
OS: | Linux |
Description
Denis G. Samsonenko
2024-10-12 18:27:35 MSK
Во-первых, схема запуска драйверов UPS полностью поменялась — теперь необходимо включить сервис nut-driver-enumerator.service, который при своём запуске добавит в systemd экземпляры сервисов nut-driver@<INSTANCE>, где <INSTANCE> соответствует имени секции в ups.conf. Во-вторых, даже после systemctl enable nut-driver-enumerator.service; systemctl start nut-driver-enumerator.service драйвер всё равно нормально не запускается. У меня конфигурация железа другая: [ups] driver = blazer_ser port = /dev/serial/by-id/usb-POWERCOM_CO.__LTD._USB_to_Serial-if00-port0 Для отладки пришлось использовать systemctl edit nut-driver@.service — добавить в ExecStart в вызов /usr/sbin/upsdrvctl опции -DDDdB: [Service] ExecStart= ExecStart=/bin/sh -c 'NUTDEV="`/usr/lib/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; /usr/sbin/upsdrvctl -u upsdrv -r $CHROOTDIR -DDDdB start "$NUTDEV"' С этими опциями получился следующий вывод: ноя 02 21:06:13 electra.home systemd[1]: Starting nut-driver@ups.service - Network UPS Tools - device driver for ups... ноя 02 21:06:13 electra.home nut-driver@ups[12221]: 0.000000 [D1] upsdrvctl commanding one driver (ups): start ноя 02 21:06:13 electra.home nut-driver@ups[12221]: 0.000012 [D1] Starting UPS: ups ноя 02 21:06:13 electra.home nut-driver@ups[12221]: 0.000021 [D2] 3 remaining attempts ноя 02 21:06:13 electra.home nut-driver@ups[12221]: 0.000026 [D2] exec: /lib/nut/blazer_ser -DDD -B -a ups -r /var/lib/nut -u upsdrv ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.000000 [D3] do_global_args: var='maxretry' val='3' ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.000039 [D3] main_arg: var='driver' val='blazer_ser' ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.000045 [D3] main_arg: var='port' val='/dev/serial/by-id/usb-POWERCOM_CO.__LTD._USB_to_Serial-if00-port0' ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.000050 [D1] Built-in default or configured user for drivers 'upsmon' was ignored due to 'upsdrv' specified on command line ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.000052 [D1] Network UPS Tools version 2.8.2 (release/snapshot of 2.8.2) built with x86_64-alt-linux-gcc (GCC) 13.2.1 20240128 (ALT Sisyphus 13.2.1-alt3) and configured with flags: --build=x86_64-alt-linux --host=x86_64-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var/lib --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --disable-silent-rules --runstatedir=/var/run --without-included-gettext --disable-static --sysconfdir=/etc/nut --datadir=/etc/nut --includedir=/usr/include/nut --with-pkgconfig-dir=/usr/lib64/pkgconfig --with-cgi --with-cgipath=/var/www/cgi-bin --with-htmlpath=/var/www/html/nut --with-ssl --with-drvpath=/lib/nut --with-statepath=/var/lib/upsd --with-usb --with-udev-dir=/usr/lib/udev --with-snmp --with-snmp --with-pkgconfig-dir=/usr/lib64/pkgconfig --with-dev --with-user=upsmon --with-group=upsmon --enable-strip=no --without-python2 ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.000067 [D1] debug level is '3' ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.120113 [D1] chrooted into /var/lib/nut ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.120139 [D1] Succeeded to become_user(upsdrv): now UID=125 GID=88 ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.120203 [D1] Saving PID 12238 into /var/lib/upsd/blazer_ser-ups.pid ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.120258 Please note that this driver is deprecated and will not receive ноя 02 21:06:13 electra.home nut-driver@ups[12238]: new development. If it works for managing your devices - fine, ноя 02 21:06:13 electra.home nut-driver@ups[12238]: but if you are running it to try setting up a new device, please ноя 02 21:06:13 electra.home nut-driver@ups[12238]: consider the newer nutdrv_qx instead, which should handle all 'Qx' ноя 02 21:06:13 electra.home nut-driver@ups[12238]: protocol variants for NUT. (Please also report if your device works ноя 02 21:06:13 electra.home nut-driver@ups[12238]: with this driver, but nutdrv_qx would not actually support it with ноя 02 21:06:13 electra.home nut-driver@ups[12238]: any subdriver!) ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.120271 [D2] Trying megatec protocol... ноя 02 21:06:13 electra.home nut-driver@ups[12238]: 0.120355 [D3] send: 'Q1' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.367915 [D3] read: '(230.0 230.0 230.0 009 50.0 26.9 35.0 00001001' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.367981 [D2] Status read in 1 tries ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.367986 Supported UPS detected with megatec protocol ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.368063 [D3] send: 'F' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.495933 [D3] read: '#220.0 007 24.00 50.0' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.495990 [D2] Ratings read in 1 tries ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.496074 [D3] send: 'I' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.696406 [D3] read: '#POWERCOM SKP-1500A S707-V1.0 ' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.696435 Vendor information read in 1 tries ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.696441 No values provided for battery high/low voltages in ups.conf ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.696450 Using 'guesstimation' (low: 20.800000, high: 26.000000)! ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.696455 Battery runtime will not be calculated (runtimecal not set) ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.696558 [D3] send: 'Q1' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.943924 [D3] read: '(228.0 228.0 228.0 009 50.0 26.9 36.0 00001001' ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.944088 [D2] dstate_init: sock /var/lib/upsd/blazer_ser-ups open on fd 6 ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.944383 [D1] Group and/or user account for this driver was customized ('upsdrv:upsmon') compared to built-in defaults. Fixing socket '/var/lib/upsd/blazer_ser-ups' ownership/access. ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.944396 [D1] WARNING: could not resolve group name 'upsmon' (0): Success ноя 02 21:06:14 electra.home nut-driver@ups[12238]: 0.944400 WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly. ноя 02 21:06:14 electra.home nut-driver@ups[12238]: Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/lib/upsd/blazer_ser-ups ноя 02 21:06:14 electra.home nut-driver@ups[12240]: Network UPS Tools - Megatec/Q1 protocol serial driver 1.61 (2.8.2) ноя 02 21:06:15 electra.home nut-driver@ups[12221]: 2.039733 [D1] upsdrvctl: successfully finished ноя 02 21:06:15 electra.home nut-driver@ups[12221]: 2.039771 [D1] Completed the job of upsdrvctl tool, cleaning up and exiting now ноя 02 21:06:15 electra.home nut-driver@ups[12221]: 2.039778 [D1] Completed the job of upsdrvctl tool, clean-up finished, exiting now ноя 02 21:06:15 electra.home nut-driver@ups[12221]: Network UPS Tools - UPS driver controller 2.8.2 ноя 02 21:06:15 electra.home nut-driver@ups[12242]: Can't open /var/lib/upsd/blazer_ser-ups.pid: No such file or directory ноя 02 21:06:15 electra.home nut-driver@ups[12242]: Can't open /var/lib/upsd/blazer_ser-usb-POWERCOM_CO.__LTD._USB_to_Serial-if00-port0.pid either: No such file or directory ноя 02 21:06:15 electra.home nut-driver@ups[12242]: Network UPS Tools - UPS driver controller 2.8.2 ноя 02 21:06:15 electra.home systemd[1]: nut-driver@ups.service: Control process exited, code=exited, status=1/FAILURE ноя 02 21:06:15 electra.home systemd[1]: nut-driver@ups.service: Failed with result 'exit-code'. ноя 02 21:06:15 electra.home systemd[1]: Failed to start nut-driver@ups.service - Network UPS Tools - device driver for ups. Удалось добиться успешного запуска драйвера путём удаления опции "-r $CHROOTDIR": [Service] ExecStart= ExecStart=/bin/sh -c 'NUTDEV="`/usr/lib/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; /usr/sbin/upsdrvctl -u upsdrv -DDDdB start "$NUTDEV"' Сообщения в журнале в этом случае: ноя 02 21:06:30 electra.home systemd[1]: Starting nut-driver@ups.service - Network UPS Tools - device driver for ups... ноя 02 21:06:30 electra.home nut-driver@ups[12323]: 0.000000 [D1] upsdrvctl commanding one driver (ups): start ноя 02 21:06:30 electra.home nut-driver@ups[12323]: 0.000007 [D1] Starting UPS: ups ноя 02 21:06:30 electra.home nut-driver@ups[12323]: 0.000013 [D2] 3 remaining attempts ноя 02 21:06:30 electra.home nut-driver@ups[12323]: 0.000016 [D2] exec: /lib/nut/blazer_ser -DDD -B -a ups -u upsdrv ноя 02 21:06:30 electra.home nut-driver@ups[12341]: 0.000000 [D3] do_global_args: var='maxretry' val='3' ноя 02 21:06:30 electra.home nut-driver@ups[12341]: 0.000043 [D3] main_arg: var='driver' val='blazer_ser' ноя 02 21:06:30 electra.home nut-driver@ups[12341]: 0.000047 [D3] main_arg: var='port' val='/dev/serial/by-id/usb-POWERCOM_CO.__LTD._USB_to_Serial-if00-port0' ноя 02 21:06:30 electra.home nut-driver@ups[12341]: 0.000053 [D1] Built-in default or configured user for drivers 'upsmon' was ignored due to 'upsdrv' specified on command line ноя 02 21:06:30 electra.home nut-driver@ups[12341]: 0.000055 [D1] Network UPS Tools version 2.8.2 (release/snapshot of 2.8.2) built with x86_64-alt-linux-gcc (GCC) 13.2.1 20240128 (ALT Sisyphus 13.2.1-alt3) and configured with flags: --build=x86_64-alt-linux --host=x86_64-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var/lib --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --disable-silent-rules --runstatedir=/var/run --without-included-gettext --disable-static --sysconfdir=/etc/nut --datadir=/etc/nut --includedir=/usr/include/nut --with-pkgconfig-dir=/usr/lib64/pkgconfig --with-cgi --with-cgipath=/var/www/cgi-bin --with-htmlpath=/var/www/html/nut --with-ssl --with-drvpath=/lib/nut --with-statepath=/var/lib/upsd --with-usb --with-udev-dir=/usr/lib/udev --with-snmp --with-snmp --with-pkgconfig-dir=/usr/lib64/pkgconfig --with-dev --with-user=upsmon --with-group=upsmon --enable-strip=no --without-python2 ноя 02 21:06:30 electra.home nut-driver@ups[12341]: 0.000070 [D1] debug level is '3' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.120714 [D1] Succeeded to become_user(upsdrv): now UID=125 GID=88 ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.120793 [D1] Saving PID 12341 into /var/lib/upsd/blazer_ser-ups.pid ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.120847 Please note that this driver is deprecated and will not receive ноя 02 21:06:31 electra.home nut-driver@ups[12341]: new development. If it works for managing your devices - fine, ноя 02 21:06:31 electra.home nut-driver@ups[12341]: but if you are running it to try setting up a new device, please ноя 02 21:06:31 electra.home nut-driver@ups[12341]: consider the newer nutdrv_qx instead, which should handle all 'Qx' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: protocol variants for NUT. (Please also report if your device works ноя 02 21:06:31 electra.home nut-driver@ups[12341]: with this driver, but nutdrv_qx would not actually support it with ноя 02 21:06:31 electra.home nut-driver@ups[12341]: any subdriver!) ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.120862 [D2] Trying megatec protocol... ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.120950 [D3] send: 'Q1' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.367499 [D3] read: '(230.0 230.0 230.0 009 50.0 26.6 36.0 00001001' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.367553 [D2] Status read in 1 tries ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.367557 Supported UPS detected with megatec protocol ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.367638 [D3] send: 'F' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.495490 [D3] read: '#220.0 007 24.00 50.0' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.495539 [D2] Ratings read in 1 tries ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.495624 [D3] send: 'I' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.695635 [D3] read: '#POWERCOM SKP-1500A S707-V1.0 ' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.695666 Vendor information read in 1 tries ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.695671 No values provided for battery high/low voltages in ups.conf ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.695680 Using 'guesstimation' (low: 20.800000, high: 26.000000)! ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.695685 Battery runtime will not be calculated (runtimecal not set) ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.695774 [D3] send: 'Q1' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.943608 [D3] read: '(230.0 230.0 230.0 008 50.0 26.6 35.0 00001001' ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.943757 [D2] dstate_init: sock /var/lib/upsd/blazer_ser-ups open on fd 5 ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.943829 [D1] Group and/or user account for this driver was customized ('upsdrv:upsmon') compared to built-in defaults. Fixing socket '/var/lib/upsd/blazer_ser-ups' ownership/access. ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.943849 [D1] WARNING: opening socket file for stat/chown failed (6), which is rather typical for Unix socket handling: No such device or address ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.943871 [D1] WARNING: chown of socket file failed (1): Operation not permitted ноя 02 21:06:31 electra.home nut-driver@ups[12341]: 0.943890 WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly. ноя 02 21:06:31 electra.home nut-driver@ups[12341]: Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/lib/upsd/blazer_ser-ups ноя 02 21:06:31 electra.home nut-driver@ups[12323]: 0.945527 [D1] upsdrvctl: successfully finished ноя 02 21:06:31 electra.home nut-driver@ups[12323]: 0.945559 [D1] Completed the job of upsdrvctl tool, cleaning up and exiting now ноя 02 21:06:31 electra.home nut-driver@ups[12323]: 0.945569 [D1] Completed the job of upsdrvctl tool, clean-up finished, exiting now ноя 02 21:06:31 electra.home nut-driver@ups[12323]: Network UPS Tools - UPS driver controller 2.8.2 ноя 02 21:06:31 electra.home systemd[1]: Started nut-driver@ups.service - Network UPS Tools - device driver for ups. Таким образом, обработка chroot где-то сломана, причём в текущей версии пакета нет нормального способа отключить chroot, не копируя всю остальную команду из ExecStart. Пересобрал в hasher версию 2.7.4-alt7. Эта версия работает нормально на p11. могу подтвердить неработающий 2.8.2 ни в сизифе, ни в р11, на кои я обновился только что. 2.8.0 - работает в обоих системах. у меня apc. основная загвоздка в старте сервиса драйвера, что вручную, что юнитом. # /usr/sbin/upsdrvctl -u upsdrv -r /var/lib/nut start "sua1500i" Network UPS Tools - UPS driver controller 2.8.2 Network UPS Tools - Generic HID driver 0.53 (2.8.2) USB communication driver (libusb 0.1) 0.47 Using subdriver: APC HID 0.100 WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly. Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/lib/upsd/usbhid-ups-sua1500i и файл(сокет?) /var/lib/upsd/usbhid-ups-sua1500i не создаётся... однако, при запуске в режиме отладки драйвера /usr/sbin/upsdrvctl -u upsdrv -D -d -r /var/lib/nut start "sua1500i" файл создаётся и начинает работать. ругань следующая (выдраны куски): USB communication driver (libusb 0.1) 0.47 0.000022 [D1] upsdrv_makevartable... 0.000089 [D1] Using USB implementation: libusb-0.1 (or compat) 0.000177 [D1] Built-in default or configured user for drivers 'upsmon' was ignored due to 'upsdrv' specified on command line 0.000185 [D1] Network UPS Tools version 2.8.2 (release/snapshot of 2.8.2) built with x86_64-alt-linux-gcc (GCC) 13.2.1 20240128 (ALT Sisyphus 13.2.1-alt3) and configured with flags: --build=x86_64-alt-linux --host=x86_64-alt-linux --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/lib --localstatedir=/var/lib --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --disable-silent-rules --runstatedir=/var/run --without-included-gettext --disable-static --sysconfdir=/etc/nut --datadir=/etc/nut --includedir=/usr/include/nut --with-pkgconfig-dir=/usr/lib64/pkgconfig --with-cgi --with-cgipath=/var/www/cgi-bin --with-htmlpath=/var/www/html/nut --with-ssl --with-drvpath=/lib/nut --with-statepath=/var/lib/upsd --with-usb --with-udev-dir=/usr/lib/udev --with-snmp --with-snmp --with-pkgconfig-dir=/usr/lib64/pkgconfig --with-dev --with-user=upsmon --with-group=upsmon --enable-strip=no --without-python2 0.000241 [D1] debug level is '1' 0.000258 [D1] upsdrv_initups (non-SHUT)... 0.097247 Using subdriver: APC HID 0.100 0.097278 [D1] 130 HID objects found %< cut 1.861613 [D1] Detected a UPS: American Power Conversion/Smart-UPS 1500 FW:653.18.I USB FW:7.3 1.864955 [D1] chrooted into /var/lib/nut 1.865020 [D1] Succeeded to become_user(upsdrv): now UID=475 GID=455 1.865037 [D1] upsdrv_initinfo... 1.865044 [D1] upsdrv_updateinfo... 1.905784 [D1] Got 1 HID objects... 1.905815 [D1] Quick update... 1.906399 [D1] Group and/or user account for this driver was customized ('upsdrv:upsmon') compared to built-in defaults. Fixing socket '/var/lib/upsd/usbhid-ups-sua1500i' ownership/access. 1.906442 [D1] WARNING: could not resolve group name 'upsmon' (0): Success 1.906453 WARNING: Needed to fix group access to filesystem socket of this driver, but failed; run the driver with more debugging to see how exactly. Consumers of the socket, such as upsd data server, can fail to interact with the driver and represent the device: /var/lib/upsd/usbhid-ups-sua1500i 1.906499 Running as foreground process, not saving a PID file 1.906530 [D1] Driver initialization completed, beginning regular infinite loop 1.906544 upsnotify: notify about state 2 with libsystemd: was requested, but not running as a service unit now, will not spam more about it 1.906566 upsnotify: failed to notify about state 2: no notification tech defined, will not spam more about it 1.906581 upsnotify: logged the systemd watchdog situation once, will not spam more about it 1.906595 [D1] upsdrv_updateinfo... 1.969787 [D1] Got 1 HID objects... 1.969826 [D1] Quick update... 3.550169 sock_connect: enabling asynchronous mode (auto) и тут работаем. |