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
  • 1
  • 4
  • Have you tried NETSERVER on? Other than that, my config file looks similar to yours. (for the entries you list- there are many others) It's working for me. – Organic Marble May 02 '16 at 23:22
  • 1
    @Organic Marble, it did it! I had tried netserver on before but it did not work. This time it did, thanks! – Breiz May 03 '16 at 13:37
  • I think that ubuntu don't have openSSH server from default. Please try running `sudo apt-get install openssh-server` and give me feedback if this solve your problem or if not what was happen? – Krzysztof Aug 06 '16 at 10:55

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
  • 1
  • 4
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
  • 69,223
  • 56
  • 216
  • 327
xwindows
  • 21
  • 1
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,451
  • 15
  • 18
  • I filed an Ubuntu bug about this here: https://bugs.launchpad.net/ubuntu/+source/apcupsd/+bug/1742558 – nh2 Jan 10 '18 at 22:21