Upgrade APCUPSD when latest release is not in repos

lpallard

Renowned Member
Mar 22, 2014
95
4
73
Hello,

I am running a Proxmox VE node for a SoHo application and I recently purchased a Smart UPS from APC (Model SMT750RM2U) which seems to use MODBUS (RS232) instead of the former simpler protocol. As a result, apcupsd that is available for proxmox (from repo: deb
http://ftp.ca.debian.org/debian wheezy main contrib) is version 3.14.10-2 and is not capable of retrieving all info and data from the UPS (for example UPS load and utility voltages are not available).

Therefore I would need to remove the current version, and somehow install 3.14.11 for Debian, but I have NO experience with Debian or its package manager and dependencies, and I am very concerned about breaking something on Proxmox (its been running flawless and rock stable for almost a year now!)..

Can someone guide me through the upgrade process? Which repo should I use? Should I install from sources or from a .deb file?

Thanks!
 
Debian Jessie has 3.14.12 so you could try to backport it.

Very good idea, but its not working and I dont know why...

I followed the instructions of the Debian wiki on how to backport packages from one Debian release to another:

1. Created "nano /etc/apt/sources.list.d/backports.list" with this line in it:

Code:
deb http://http.debian.net/debian jessie-backports main

2. Ran apt-get update (all went fine, I saw the jessie repos being listed)

3. Tried to install apcupsd (dry run) specifying the "jessie-backports" repo but its insisting on installing 3.14.10......

Code:
root@proxmox:/etc/apt/sources.list.d# apt-get -t jessie-backports --dry-run install apcupsd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libgd2-noxpm
Use 'apt-get autoremove' to remove it.
Suggested packages:
  apcupsd-cgi
The following NEW packages will be installed:
  apcupsd
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Inst apcupsd (3.14.10-2 Debian:7.8/oldstable [amd64])
Conf apcupsd (3.14.10-2 Debian:7.8/oldstable [amd64])


!??! Debian experts ? :)
 
The apcupsd-3.14.12 is not in the jessie-backports repo so you will have to backport it yourself.

Considering I dont have any experience with Debian and backporting, and the criticallity of this proxmox node, I think I will pass for now and maybe try in a dummy proxmox install (a test VM). After all its not only installing the package files but there are other dependencies and I am not confident that this will not cause issues down the road.

Perhaps this package will be ported to 3.14.12 later on... In a commercial setting, APC upses are very popular and I am very surprised that nobody use a modern UPS with proxmox?!
 
As a dirty temporary workaround, which isn't dirty because it's difficult (it's fairly easy) but because you install the program out of the scope from the package manager and so don't get automatic updates, build it yourself.
I tried it successfully on a fresh installed Debian Wheezy (7.8).

Download latest apcupsd-3.x.x.tar.gz from here: http://sourceforge.net/projects/apcupsd/files/apcupsd - Stable/3.14.13/
install the build-essential package
Code:
apt-get install build-essential
extract the apcupsd-3.14.13.tar.gz and cd into the directory. Then use:
Code:
./configure
make
# and the following one as root
make install
and your done.
Compiles without problems and it's system wide installed after that. Unfortunately I haven't UPS at hand to test it with hardware.
 
Exactly as I suspected I managed to really screw up...

After trying to compile from sources, I abandonned because it was complaining that there was some missing libraries (mainly libGD). After retrying with barely any options in ./configure, it finally compiled but upon execution, it was aborting complaining that there was some problems with undefined flags... I guess gcc problems or something in that line of thought... Anyways getting too complicated, I thought lets go back to the packages.

So I ran a "make uninstall", cd'd to the upper directory, deleted the sources directory and ran apt-get update, then

Code:
apt-get install apcupsd apcupsd-cgi

Both installed OK.

But when I tried to start the service, I got

Code:
root@proxmox:/etc/apcupsd# service apcupsd start
apcupsd: unrecognized service

Strange! then I tried

Code:
root@proxmox:/etc/apcupsd# /etc/init.d/apcupsd start
-bash: /etc/init.d/apcupsd: No such file or directory

It seems the service script is no longer installed! Manually starting apcupsd works, the CGI page shows the UPS data, all is well, except when I try to simulate a power outage by unplugging the server, I get errors such as

Code:
Message from syslogd@proxmox at Jul 12 13:03:07 ...
 nnot exec /etc/apcupsd/apccontrol powerout: No such file or directory

Message from syslogd@proxmox at Jul 12 13:03:08 ...
 nnot exec /etc/apcupsd/apccontrol onbattery: No such file or directory

Message from syslogd@proxmox at Jul 12 13:03:12 ...
 nnot exec /etc/apcupsd/apccontrol offbattery: No such file or directory

Message from syslogd@proxmox at Jul 12 13:03:12 ...
 nnot exec /etc/apcupsd/apccontrol mainsback: No such file or directory

And I no longer get emails informing me of the outage...

So it seems that somehow apcupsd package installs partially and no longer install the scripts and service files....

I've never seen this before in CentOS or Ubuntu...

Scratching my head real hard now...
 
OK managed to recreate the startup script from Debian's wikis and the powerout/onbatt/offbatt.. scripts from other sources.

All is working well now.
 
Damn, sorry about that, as it compiled without any problems here with a minimal setup i thought it wouldn't be a big deal to do it...

Really glad you figured it out and all is working now!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!