Koozali.org: home of the SME Server

Contribs.org Forums => Koozali SME Server 10.x => Topic started by: sages on April 25, 2021, 11:13:47 AM

Title: nut ups connection issue to usb UPS
Post by: sages on April 25, 2021, 11:13:47 AM
reused my UPS and config from sme9 server to new server hardware and ported the ups config across. Currently have a communication issue with the UPS failing.
Has anyone got a working UPS on sme10rc1?
Any issues doing so?
Title: Re: nut ups connection issue to usb UPS
Post by: sages on April 25, 2021, 03:02:40 PM
If I run upsd from the command line instead of via the new systemd control (see https://wiki.koozali.org/Uninterruptable_Power_Supply#Default_Configuration_.28USB.29 ) the upsd starts and finds the UPS device as expected.
Suggesting that there is an issue with how the nut.service is trying to start up upsd.
[edit]

if i run systemctl start nut.service upsd fails to run and reports connection error.
if I run systemctl start nut-server.service, upsd starts, continues to run and I can access the UPS.
hth
Title: Re: nut ups connection issue to usb UPS
Post by: TerryF on April 25, 2021, 03:39:20 PM
I have ups working on my snme10 home system with a eaton ups..unlike your example..

[root@home ~]#  systemctl status nut.service
● nut.service - Network UPS Tools - Master service for Koozali SME Srrver
   Loaded: loaded (/usr/lib/systemd/system/nut.service; enabled; vendor preset: enabled)
   Active: active (exited) since Sat 2021-04-24 13:42:25 AEST; 1 day 9h ago
  Process: 1178 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
  Process: 1174 ExecStartPre=/sbin/e-smith/expand-template /etc/ups/upssched.conf (code=exited, status=0/SUCCESS)
  Process: 1169 ExecStartPre=/sbin/e-smith/expand-template /etc/ups/upsmon.conf (code=exited, status=0/SUCCESS)
  Process: 1141 ExecStartPre=/sbin/e-smith/expand-template /etc/ups/upsd.users (code=exited, status=0/SUCCESS)
  Process: 1133 ExecStartPre=/sbin/e-smith/expand-template /etc/ups/upsd.conf (code=exited, status=0/SUCCESS)
  Process: 1063 ExecStartPre=/sbin/e-smith/expand-template /etc/ups/ups.conf (code=exited, status=0/SUCCESS)
  Process: 916 ExecStartPre=/sbin/e-smith/expand-template /etc/sysconfig/ups (code=exited, status=0/SUCCESS)
  Process: 801 ExecStartPre=/sbin/e-smith/service-status nut (code=exited, status=0/SUCCESS)
 Main PID: 1178 (code=exited, status=0/SUCCESS)
   Memory: 0B
   CGroup: /system.slice/nut.service

Apr 24 13:42:18 mydomain.dyndns.org systemd[1]: Starting Network UPS Tools - Master service for Koozali SME Srrver...
Apr 24 13:42:25 mydomain.dyndns.org systemd[1]: Started Network UPS Tools - Master service for Koozali SME Srrver.

[root@home ~]#  systemctl status nut.server.service
Unit nut.server.service could not be found.
Title: Re: nut ups connection issue to usb UPS
Post by: TerryF on April 25, 2021, 03:41:49 PM
This is my nut config

[root@home ~]# config show nut
nut=service
    AdminPass=123456
    AdminUser=disabled
    MasterPass=123456
    Model=usbhid-ups
    SlavePass=123456
    access=localhost
    status=enabled

passwords etc obfuscated

[root@home ~]# rpm -q e-smith-nutUPS
e-smith-nutUPS-2.6.0-11.el7.sme.noarch

Title: Re: nut ups connection issue to usb UPS
Post by: sages on April 25, 2021, 03:43:53 PM
shouldn't be 'nut.server.service' but should be 'nut-server.service'

I'll play again tomorrow. Thanks for the confirmation of a working system.
Title: Re: nut ups connection issue to usb UPS
Post by: TerryF on April 25, 2021, 03:45:42 PM
I did not have to do any extra setup apart from enabling
Title: Re: nut ups connection issue to usb UPS
Post by: TerryF on April 25, 2021, 03:46:27 PM
shouldn't be 'nut.server.service' but should be 'nut-server.service'

I'll play again tomorrow. Thanks for the confirmation of a working system.

My error

[root@home ~]#  systemctl status nut-server.service
● nut-server.service - Network UPS Tools - power devices information server
   Loaded: loaded (/usr/lib/systemd/system/nut-server.service; enabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/nut-server.service.d
           └─50koozali.conf
   Active: active (running) since Sat 2021-04-24 13:42:25 AEST; 1 day 10h ago
  Process: 1180 ExecStartPre=/sbin/e-smith/service-status nut (code=exited, status=0/SUCCESS)
 Main PID: 1188 (upsd)
   Memory: 604.0K
   CGroup: /system.slice/nut-server.service
           └─1188 /usr/sbin/upsd -F

Apr 24 13:42:25 mydomain.dyndns.org systemd[1]: Starting Network UPS Tools - power devices information server...
Apr 24 13:42:25 mydomain.dyndns.org systemd[1]: Started Network UPS Tools - power devices information server.
Apr 24 13:42:25 mydomain.dyndns.org upsd[1188]: fopen /var/run/nut/upsd.pid: No such file or directory
Apr 24 13:42:25 mydomain.dyndns.org upsd[1188]: listening on 127.0.0.1 port 3493
Apr 24 13:42:25 mydomain.dyndns.org upsd[1188]: listening on 127.0.0.1 port 3493
Apr 24 13:42:25 mydomain.dyndns.org upsd[1188]: Connected to UPS [UPS]: usbhid-ups-UPS
Apr 24 13:42:25 mydomain.dyndns.org upsd[1188]: Connected to UPS [UPS]: usbhid-ups-UPS
Title: Re: nut ups connection issue to usb UPS
Post by: TerryF on April 25, 2021, 04:00:34 PM
also see this bug 9423 that is closed and doco bug 11238 that has yet to be worked on