2

I've browsed numerous forums, but couldn't find the answer for setting up my UPS (EC350G).

Here is my configuration:

  • Ubuntu 16.04 LTS
  • APCUPSD 3.14.12
  • /etc/apcupsd/apcupsd.conf: UPSCABLE usb, USBTYPE usb, DEVICE, NETSERVER OFF
  • ps -ef | grep apcupsd => root 2578 1 0 17:58 ? 00:00:00 /sbin/apcupsd
  • sudo service apcupsd status

apcupsd.service - LSB: Starts apcupsd daemon

 Loaded: loaded (/etc/init.d/apcupsd; bad; vendor preset: enabled)
 Active: active (running) since Mon 2016-05-02 17:58:06 CDT; 4min 34s ago
 Docs: man:systemd-sysv-generator(8)
 Process: 2553 ExecStop=/etc/init.d/apcupsd stop (code=exited, status=0/SUCCESS)
 Process: 2573 ExecStart=/etc/init.d/apcupsd start (code=exited, status=0/SUCCESS)
 Tasks: 2 (limit: 512)
 CGroup: /system.slice/apcupsd.service
       └─2578 /sbin/apcupsd}

And finally: sudo apcaccess status

Error contacting apcupsd @ 127.0.0.1:3551: Connection refused
Breiz
  • 141

3 Answers3

2

As Organic Marble suggested, I set NETSERVER to on and the status eventually worked. I do not use remote monitoring though. If that can help, NISIP is 127.0.0.1.

Breiz
  • 141
2

I had NETSERVER on and it still didn't work. The additional setting that fixed it for me was adding ISCONFIGURED=yes in /etc/default/apcupsd, as described in https://help.ubuntu.com/community/apcupsd.

Zanna
  • 72,312
1

I see your sudo service apcupsd status reports otherwise, but for me on Ubuntu 16.04, apcupsd wasn't actually running. It didn't appear in ps aux | grep apc and I got:

% systemctl status apcupsd
● apcupsd.service - LSB: Starts apcupsd daemon
   Loaded: loaded (/etc/init.d/apcupsd; bad; vendor preset: enabled)
   Active: active (exited) since Wed 2018-01-10 22:21:00 CET; 34min ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 0
   Memory: 0B
      CPU: 0

Note the active (exited) and no processes shown.

I suspect that in this case the systemd-sysv-generator messed up and cannot correctly start this SysV-Init unit. So basically, the systemd service seems broken in this version of Ubuntu.

I fixed it by just installing a proper systemd unit using:

curl https://gist.githubusercontent.com/nh2/e6089d30ddc6be6191037b5098f1adb9/raw/f08e4174286cbba6ab19f619d896da265cb81552/apcupsd.service | sudo tee /etc/systemd/system/apcupsd.service
sudo systemctl daemon-reload

After that, I can sudo service apcupsd start all fine.

nh2
  • 1,831
  • 2
  • 18
  • 19