Package Details: network-ups-tools 2.7.4-2

Git Clone URL: https://aur.archlinux.org/network-ups-tools.git (read-only)
Package Base: network-ups-tools
Description: NUT is a collection of programs for monitoring and administering UPS hardware
Upstream URL: http://www.networkupstools.org/
Licenses: GPL2
Submitter: Atsutane
Maintainer: The-Compiler
Last Packager: The-Compiler
Votes: 65
Popularity: 0.588784
First Submitted: 2010-09-21 19:10
Last Updated: 2016-05-30 13:43

Latest Comments

hexadecagram commented on 2016-07-05 08:53

Done.

https://github.com/networkupstools/nut/issues/299

The-Compiler commented on 2016-07-05 08:39

@hexadecagram I suggest suggesting this in the upstream bugtracker: https://github.com/networkupstools/nut/issues

I'd rather avoid applying patches which aren't coming from upstream.

hexadecagram commented on 2016-07-05 08:37

If I use udev to set different permission on the device node for my USB, nut-driver.service doesn't start up on boot. If I then login and restart nut-driver.service, it works.

The systemd functionality described in this blog supposedly worked at one time (I never tried it myself):

https://www.kepstin.ca/blog/networkupstoolsnutandsystemd/

After much trial and error, I set After=network-online.target and Requires=network-online.target for both nut-driver.service and nut-server.service (the latter of which should have those configurations regardless, because upsd will fail to start if the network is not online). Boom, it works. I tried quite a few unit files before that, all the way up the chain to upower.service. Nothing else worked.

I think a more appropriate fix would be to add something like the following in nut-driver.service. This will work for now but I think the ideal solution would to be to remove the nut-driver.service dependency in nut-server.service and work it into udev so that drivers are reloaded when devices are hotplugged.

[Service]
Restart=on-failure
RestartSec=10

precurse commented on 2016-06-05 02:00

Much thanks The-Compiler :)

The-Compiler commented on 2016-05-30 13:47

@hexadecagram Thanks for bringing this up again, must've gotten lost in all the mails I get last time ;) -2 now installs them there, I agree that sounds like the right location.

@precurse @augiedoggie @lulingar @travesh Okay, I give up, I added armv6h and armv7h, even though they aren't official architectures...

hexadecagram commented on 2016-05-26 08:00

This package still conflicts with the rhino package, even though this was first reported in 2012!

To get the ball rolling, all it would take is a simple one-line edit of PKGBUILD so that the build() step calls ./configure with --with-drvpath=/usr/lib/network-ups-tools (my recommendation for where the binaries should go, in accordance with the hier manpage).

precurse commented on 2016-05-22 23:41

I've successfully compiled and used this with RP1 and RP2.. armv6h and armv7h.

augiedoggie commented on 2016-04-22 00:59

I agree with @lulingar, it would be nice to have armv7h added to the architectures. The package runs fine on my Pandaboard ES.

lulingar commented on 2016-04-05 19:09

The architecture armv7h might be added as well. I have successfully built and installed the package on a Raspberry Pi 2.

The-Compiler commented on 2016-01-04 09:28

Sorry for the delay - I added the patch to the package now.

Let me know if anything else is missing!

zman0900 commented on 2015-12-19 20:18

nut-driver.service is not starting as expected in new installs. It is supposed to be started automatically by nut-server.service. It still works for older installs because the links in /etc/systemd/system/multi-user.target.want/ still exists for nut-driver. Looks like this was broken when upstream removed the Requires= from nut-server.service. It was fixed by adding a Wants= instead:

https://github.com/networkupstools/nut/commit/c98fab9f5dec993aa9f5e0a3e79de53ae9ecd32b

Can this patch be added to this package?

precurse commented on 2015-10-20 06:20

In case anyone wants to know..

This was the fix for me: https://github.com/networkupstools/nut/commit/c98fab9f5dec993aa9f5e0a3e79de53ae9ecd32b

precurse commented on 2015-10-12 07:28

nut-driver refuses to start for me unless I run "upsdrvctl start" manually even though upsmon and upsd start without issue. It also lets me start the driver (manually) if I change the systemd service to "StopWhenUnneeded=no" and running the systemctl start nut-driver. Systemd keeps unloading it saying it's no longer needed otherwise.

Anyone else seeing this issue?

pattyo commented on 2015-06-24 01:28

Hi,

is there any chance this could be updated to build with the "--with-dev" configure option so that headers are installed?

Thanks.

zman0900 commented on 2015-06-09 20:43

I finally installed the update from April today, and I still ran into the file conflict with rhino. I found that it can be worked around by using the "--with-drvpath=PATH" config option. I gave it /usr/bin/nut-drivers/ for the path, and everything seems to be working fine for my ups using usbhid driver. I tried to use /usr/share/ups/drivers/, but that broke the build for some reason.

fdservices commented on 2015-05-06 09:22

Exactly right

Thank you

rdoursenaud commented on 2015-05-05 14:12

@fdservices
You may be experiencing the same issue I had because of a systemd unit dependency change.
See my comments on https://github.com/networkupstools/nut/issues/200

The-Compiler commented on 2015-04-27 06:59

Whoops! Fixed, thanks a lot!

max.bra commented on 2015-04-27 06:53

Hi The-Compiler,
you should modify

--with-systemdsystemunitdir=/lib/systemd/system \

to

--with-systemdsystemunitdir=/usr/lib/systemd/system \

or it will generate a conflict with filesystem package. /lib is a symlink.

zman0900 commented on 2015-02-11 17:18

I doubt it. The rhino binary here appears to be a used for one specific model of ups, and it has been in this package for some time. The rhino package has been around for over 6 years too, so I assume this conflict has existed for a long time. I just happened to notice it now because I tried and failed to install rhino because of the file conflict.

fdservices commented on 2015-02-11 15:28

Is that why my UPS software stopped communicating with my UPS today?

zman0900 commented on 2015-02-11 08:33

I just discovered that /usr/bin/rhino in this package conflicts with extra/rhino package. Not sure what if anything can actually be done about this.

TheRealSoup commented on 2014-02-27 17:22

All good now.
Thank you for your awesome response.

The-Compiler commented on 2014-02-27 11:58

I guess you're getting this, right?

==> Verifying source file signatures with gpg...
nut-2.7.1.tar.gz ... FAILED (unknown public key DB6414CA204DDF1B)
==> WARNING: Warnings have occurred while verifying the signatures.
Please make sure you really trust them.

This is because I added GPG signature verification to the package. You basically have three options:

- Ignore the warning, then you'll not benifit from the signature verification but nothing changes for you compared to the package before.

- Configure GPG to auto-fetch keys, by setting "keyserver = ..." and "keyserver-options = auto-key-retrieve" in your ~/.gnupg/gpg.conf, then it'll fetch the public key and verify it automatically.

- Fetch the key yourself by doing:
$ gpg --fetch-keys http://www.networkupstools.org/source/nut-key.gpg

TheRealSoup commented on 2014-02-27 09:37

Anyone else getting this?

==> Verifying source file signatures with gpg...
nut-2.7.1.tar.gz ... FAILED

The-Compiler commented on 2014-02-24 12:25

Adopted and updated to 2.7.1. I adopted some of zman0900's fixes, although I won't include arm* as architecture as it's not an official architecture.

travesh commented on 2014-02-08 17:01

Dan, thanks again for taking this on. Arch Linux ARM builds and works as is using your 2.7.1. Docs build is rather slow on embedded ARM, as it can't be distcc'd to faster hosts. SNMP users may want to check specific UPS support, as IETF fallback seems somewhat broken in 2.7.1.

zman0900 commented on 2014-01-29 05:38

I made an updated PKGBUILD for 2.7.1. Its nearly the same as Atsutane's current version, but I added a few missing dependencies, and more explicitly defined what options are enabled. Also, I removed the old init file since we have systemd now, and added the documentation. Look in /usr/share/doc/network-ups-tools. I added in the arm arches too, since travesh reports them to work, and the Debian package is build for all of their arches.

https://gist.github.com/zman0900/8682369#file-pkgbuild-network-ups-tools

If you are interested in the NUT-Monitor GUI, I also created a separate package for that here:

https://aur.archlinux.org/packages/nut-monitor/

travesh commented on 2013-10-12 16:21

Thanks, zman0900 for the helpful work and comments. I've modified that PKGBUILD to include support for ARM and SNMP, placing it here:
http://www.mudbury.com/linux/arch/network-ups-tools/PKGBUILD-travesh-20131012
This is working for me on Arch Linux ARM on BeagleBone Black hardware. Should also work on Raspberry Pi (and of course x86).

--- PKGBUILD-network-ups-tools 2013-10-10 23:13:18.859094762 -0400
+++ PKGBUILD-travesh-20131012 2013-10-12 11:00:22.063110119 -0400
@@ -4,12 +4,12 @@

pkgname=network-ups-tools
pkgver=2.6.5
-pkgrel=3
+pkgrel=5
pkgdesc="NUT is a collection of programs for monitoring and administering UPS hardware"
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'armv6h' 'armv7h')
url="http://www.networkupstools.org/"
license=('GPL2')
-depends=('openssl' 'libusb-compat')
+depends=('openssl' 'libusb-compat' 'net-snmp' 'desktop-file-utils')
makedepends=()
optdepends=('python2: for nut-monitor gui')
backup=(etc/ups/{ups.conf,upsd.conf,upsd.users,upsmon.conf,upssched.conf})
@@ -29,10 +29,11 @@
sed -i 's|/usr/bin/env python|/usr/bin/env python2.7|' scripts/python/app/NUT-Monitor

./configure \
- --without-wrap \
+ --without-wrap \
--with-user=ups \
--with-group=nut \
--with-usb \
+ --with-snmp \
--prefix=/usr \
--with-udev-dir=/usr/lib/udev \
--with-systemdsystemunitdir=/lib/systemd/system \

zman0900 commented on 2013-06-19 04:49

Using --sbindir and --with-drvpath works for me. Here's my working PKGBUILD: https://dl.dropboxusercontent.com/u/50802094/PKGBUILD-network-ups-tools

Note that this has the nut-monitor GUI enabled as well.

kurych commented on 2013-06-08 10:13

Yes, option "--sbindir" is necessary for the correct path. And second thing: if you add option "--with-drvpath=/usr/bin", patch file "nut-driver.service.patch" will not be necessary.

denn commented on 2013-06-04 18:28

Due to /bin, /sbin and /usr/sbin are now merged into /usr/bin, it is needed add --sbindir=/usr/bin to the configure command line.

Anonymous comment on 2013-02-08 17:06

Also, this does not compile with snmp support, edit the PKGBUILD and under --with-usb\ add the line --with-snmp \ . Make sure you have the required dependencies installed it should just be the net-snmp package in the extra repos.

Anonymous comment on 2013-02-07 20:40

For the record: this compiles without issue on the RaspberryPi, so you can add 'armv6h' to the supported architectures.

Also, for those that are having issues (like I was) with usb UPSs, try executing upsdrvctl start .

Otherwise, keep up the good work.

zman0900 commented on 2013-01-29 23:53

I made a patch to enable installing the nut-monitor python gui, and also fix permissions of a few config files.

http://dl.dropbox.com/u/50802094/enable-nut-monitor.patch


diff -ur network-ups-tools.orig/nut.install network-ups-tools/nut.install
--- network-ups-tools.orig/nut.install 2011-02-27 11:53:24.000000000 -0500
+++ network-ups-tools/nut.install 2013-01-29 18:40:13.227550729 -0500
@@ -4,7 +4,7 @@
mkdir -p /var/state/ups/
chmod 0770 /var/state/ups/
chown root:nut /var/state/ups/
- chown root:nut /etc/ups/upsd.conf /etc/ups/upsd.users /etc/ups/upsmon.conf
+ chown root:nut /etc/ups/nut.conf /etc/ups/ups.conf /etc/ups/upsd.conf /etc/ups/upsd.users /etc/ups/upsmon.conf /etc/ups/upssched.conf
echo ">>> Before starting your UPSd daemon, you must"
echo ">>> edit /etc/ups/ups.conf in order to set your"
echo ">>> UPS driver and port."
diff -ur network-ups-tools.orig/PKGBUILD network-ups-tools/PKGBUILD
--- network-ups-tools.orig/PKGBUILD 2012-10-21 06:13:11.000000000 -0400
+++ network-ups-tools/PKGBUILD 2013-01-29 18:44:09.268473116 -0500
@@ -4,13 +4,14 @@

pkgname=network-ups-tools
pkgver=2.6.5
-pkgrel=2
+pkgrel=3
pkgdesc="NUT is a collection of programs for monitoring and administering UPS hardware"
arch=('i686' 'x86_64')
url="http://www.networkupstools.org/"
license=('GPL2')
depends=('openssl' 'libusb-compat')
makedepends=()
+optdepends=('python2: for nut-monitor gui')
backup=(etc/ups/{ups.conf,upsd.conf,upsd.users,upsmon.conf,upssched.conf})
install=nut.install
source=("http://www.networkupstools.org/source/2.6/nut-$pkgver.tar.gz"
@@ -23,6 +24,11 @@
build() {

cd $srcdir/nut-$pkgver
+
+ sed -i 's|=NUT-Monitor|=nut-monitor|' scripts/python/app/nut-monitor.desktop
+ sed -i "s|sys.argv\[0\]|'/usr/share/nut/nut-monitor/nut-monitor'|" scripts/python/app/NUT-Monitor
+ sed -i 's|/usr/bin/env python|/usr/bin/env python2.7|' scripts/python/app/NUT-Monitor
+
./configure \
--without-wrap \
--with-user=ups \
@@ -50,6 +56,15 @@
install -D -m640 conf/upsmon.conf.sample $pkgdir/etc/ups/upsmon.conf
install -D -m644 conf/upssched.conf.sample $pkgdir/etc/ups/upssched.conf

+ install -D -m644 scripts/python/module/PyNUT.py $pkgdir/usr/lib/python2.7/site-packages/PyNUT.py
+ mkdir -p $pkgdir/usr/share/nut/nut-monitor/pixmaps
+ install -m 755 scripts/python/app/NUT-Monitor $pkgdir/usr/share/nut/nut-monitor/nut-monitor
+ install -m 644 scripts/python/app/gui-1.3.glade $pkgdir/usr/share/nut/nut-monitor
+ install -m 644 scripts/python/app/pixmaps/* $pkgdir/usr/share/nut/nut-monitor/pixmaps/
+ install -D scripts/python/app/nut-monitor.png $pkgdir/usr/share/pixmaps/nut-monitor.png
+ desktop-file-install --dir=$pkgdir/usr/share/applications scripts/python/app/nut-monitor.desktop
+ ln -s /usr/share/nut/nut-monitor/nut-monitor $pkgdir/usr/bin/nut-monitor
+
# Fix systemd's nut-driver.service
cd $pkgdir
patch -p1 < ../nut-driver.service.patch

BeepDog commented on 2013-01-17 04:26

I'm building using these instructions: https://wiki.archlinux.org/index.php/DeveloperWiki:Building_in_a_Clean_Chroot

I got it to successfully build changing two lines:
install -D -m755 $srcdir/upsd.init $pkgdir/etc/rc.d/upsd || return 1
and
patch -p1 < $srcdir/nut-driver.service.patch

Works fine after that.

BeepDog commented on 2013-01-17 04:02

I'm getting a failure building this:

make[2]: Leaving directory `/build/src/nut-2.6.5'
make[1]: Leaving directory `/build/src/nut-2.6.5'
install: cannot stat '/build/upsd.init': No such file or directory

this line:
`install -D -m755 $startdir/upsd.init $pkgdir/etc/rc.d/upsd || return 1`
seems to be at fault. It doesn't seem to be able to find upsd.init.

realx commented on 2012-10-21 10:18

configure options updated, thanks mrechte

mrechte commented on 2012-10-19 15:57

Could you please check the configure options? The current ones create a /share directory at the root of the fs. I suggest:

--prefix=/usr \
--with-udev-dir=/usr/lib/udev \
--with-systemdsystemunitdir=/lib/systemd/system/ \
--datadir=/usr/share/ups \
--with-udev-dir=/usr/lib/udev \
--sysconfdir=/etc/ups || return 1

mrechte commented on 2012-10-16 06:04

The nut-driver.service.patch problem has been reported upstream and should be corrected in next release. See http://trac.networkupstools.org/projects/nut/changeset/3757

realx commented on 2012-10-15 19:17

updated to 2.6.5

realx commented on 2012-10-15 19:15

updated to 2.6.5

gborzi commented on 2012-07-17 20:28

I suggest adding --with-udev-dir=/usr/lib/udev to configure and !makeflags in options.

gborzi commented on 2012-07-17 20:16

I suggest adding --with-udev-dir=/usr/lib/udev to configure and !makeflags in options.

apoulos commented on 2012-07-14 16:11

upsd.init md5sum: 089ea4a56552253328d17603ff5670cc

Anonymous comment on 2012-07-11 16:14

"USB drivers requested, but libusb not found." error while trying to compile.
Solved by installing libusb-compat. Dependencies should probably be updated.
To build a new version, change pkgver to 2.6.4 and md5sum to 78d672fbbcd90683e49c667665a95f87

andrej commented on 2012-06-09 14:53

Those udev rules were moved to /usr/lib/udev/rules.d, so --with-udev-dir=/usr/lib/udev might be a better option. Only files created and edited by users hould be in /etc/udev, AFAIK.

dimich commented on 2012-06-03 00:14

Sience udev is replaced with systemd-tools NUT doesn't work with Megatec/Q1 USB device (blazer_usb) from scratch.
Workaround is to copy /lib/udev/rules.d/52-nut-usbups.rules to /etc/udev/rules.d/.
Better solution is to add --with-udev-dir=/etc/udev to the PKGBUILD.

ghen commented on 2012-05-06 07:10

As a workaround I rebuilt my package with "--with-drivers=usbhid-ups" to install only the UPS driver I need.

ghen commented on 2012-05-06 07:07

This package now conflicts with rhino from [extra] (dependency for jre7-openjdk) due to /usr/bin/rhino UPS driver...

Perhaps it's a better idea to install the drivers in another location than /usr/bin?

kite commented on 2011-12-15 16:13

2andrej: not every "UPS's firmware" supports delay before shutdown... So "upscmd shutdown" should be executed only after all filesystems are mounted in readolny and raid arrays are stopped. It's very dangerous to execute it on "/etc/rc.d/upsd stop".

andrej commented on 2011-09-25 01:27

It would be nice to have support for automatic load shutdown on system shutdown. If you do not shut down the load, the UPS keeps powering the machines in their standby mode (which can be tens of watts for enterprise-class servers). This may shorten the battery lifetime due to deep discharge.

All the necessary information is contained in the default comments in /etc/ups/upsmon.conf. When upsmon shuts the system down, it first creates a file called /etc/killpower. The shutdown scripts should then check for this file's existence and shut down the UPS when it's present. This can be (of course) delayed by the UPS's firmware to allow proper shutdown of the hardware. Supposing one has a UPS called 'eaton', a suitable command would look like this:

/usr/bin/upscmd eaton shutdown.return

The delay before shutdown can be configured by driver-specific commands or at driver startup. A command similar to the above could be included in the stop() function of /etc/rc.d/upsd, such as if [ -f /etc/killpower ]; then ... ; fi.

jimduchek commented on 2011-07-19 18:10

Suggest the nut.install also remove the user 'nut' -- a much older version of this package used that instead of 'ups' as the username (but with the same ID -- 55, so the useradd ups fails).

Thanks.

realx commented on 2011-07-18 08:34

updated to 2.6.1-2,
without tcp_wrappers dependency

ghen commented on 2011-07-17 16:33

Could you please rebuild without tcp_wrappers dependency / --without-wrap?

mandos commented on 2011-07-06 13:14

Just made it work with my Mustek and my MGE, great software!

Is the CGI interface available in this package? It would be great to have some feedback on battery status.

android commented on 2011-06-12 14:42

Before adding udev rules, make sure your ups is not included in the stock nut rules: /lib/udev/rules.d/52-nut-usbups.rules

Also, if it was working before, udev rule may not be the issue.

On upgrade I had permission issues due to username change. (Why change names? Matching username:groupname, nut:nut, seemed more logical)

realx commented on 2011-06-12 08:00

mikes, 2 solutions:

1. chmod a+rw /dev/bus/usb/004/001 (use correct USB device node)
2. create udev rule to grant access for ups driver. my own rule - /etc/udev/rules.d/53-nut-usbups.rules (use lsusb to get your vendor and product ids)

ACTION!="add|change", GOTO="nut-usbups_rules_end"
SUBSYSTEM=="usb_device", GOTO="nut-usbups_rules_real"
SUBSYSTEM=="usb", GOTO="nut-usbups_rules_real"
SUBSYSTEM!="usb", GOTO="nut-usbups_rules_end"
LABEL="nut-usbups_rules_real"
# Ippon Back Power pro 700
ATTR{idVendor}=="0665", ATTR{idProduct}=="5161", MODE="664", GROUP="nut"
LABEL="nut-usbups_rules_end"

android commented on 2011-06-12 01:46

Hey, Thanks for the update realx!

mikes: I noticed the nut user changed from 'nut' to 'ups'.

Since both users are trying to use the uid of 55, I think the nut.install useradd will fail.

If you manually 'userdel nut' the old nut user, then reinstall the package, that should fix it up.

('grep 55 /etc/passwd', to see if you have the existing user)

mikes commented on 2011-06-11 23:32

Updated to latest version and it stopped working. I give the command "upsdrvctl start" as root and the result is :


Network UPS Tools - UPS driver controller 2.6.1
Network UPS Tools - Megatec/Q1 protocol USB driver 0.03 (2.6.1)
libusb couldn't open USB device /dev/bus/usb/001/001: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/002: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/004: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/001/005: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/001: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/003/001: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/003/003: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/004/001: Permission denied.
libusb requires write access to USB device nodes.
No supported devices found. Please check your device availability with 'lsusb'
and make sure you have an up-to-date version of NUT. If this does not help,
try running the driver with at least 'subdriver', 'vendorid' and 'productid'
options specified. Please refer to the man page for details about these options
(man 8 blazer).

Driver failed to start (exit status=1)


Any idea?

realx commented on 2011-06-11 11:33

updated

mrechte commented on 2011-05-11 13:23

To do the trick I added /etc/rc.d/functions.d/myhooks containing:

function shutdown_ups {
if [ -f /etc/killpower ]; then
/usr/bin/upsdrvctl shutdown
fi
}

add_hook shutdown_poweroff shutdown_ups

mrechte commented on 2011-05-11 10:35

Hello. I am a bit new with Arch, but it seems to me that whenever there is a shutdown due to upsmon action, the Arch shutdown procedure should check the /etc/killpower presence and if so issue the "/usr/bin/upsdrvctl shutdown" command in order to stop the UPS.

mrechte commented on 2011-04-15 10:34

Great work. Thanks

realx commented on 2011-02-27 16:59

updated to 2.6.0-1