Sign inSign up

hlhd/nut

By hlhd

•Updated 1 day ago

Network UPS Tools drivers, upsd and optional upsmon, rootless.

Image
0

337

hlhd/nut repository overview

⁠Network UPS Tools

A rootless container image of Network UPS Tools⁠: USB, serial, SNMP and NetXML drivers, upsd, and optional upsmon, built from this tree.

The purpose of this fork is to close an issue; shutdown.return on eaton_pw_nm2 / eaton_pxg_ups (Eaton Network-M2 / PXG cards) writes xupsLoadShedSecsWithRestart without its .0 instance, so the card answers noSuchName and the UPS never cuts and restores its output (nut#1571⁠). Without that command a host shut down on battery stays off if utility returns before the UPS powers down. The fork tracks upstream and is rebased onto each release; apart from this fix it is identical to the upstream version it is built from, so a given fork tag is equivalent to the same upstream version.

GitHub GitLab license Open Issues Open PRs Contributors donate sponsor

release build Last Commit StageFreight

GHCR Docker pulls Harbor

latest updated size latest-dev updated size

⁠What it runs:
Drivers + upsdupsdrvctl -F start and upsd -F in the foreground; any process exiting ends the container
upsmon, opt-inRuns only when /etc/nut/upsmon.conf is mounted; without it the container shuts nothing down
DriversUSB (usbhid-ups, blazer_usb, nutdrv_qx, …), serial, SNMP, NetXML; TLS via OpenSSL
Rootlessuid/gid 65532, no setuid binaries, no package manager; runs with a read-only root filesystem and no capabilities

nut-scanner is not built.

⁠Fork fixes:
FixUpstream
shutdown.return on eaton_pw_nm2 / eaton_pxg_ups targets xupsLoadShedSecsWithRestart.0nut#1571⁠

⁠Quick Start

docker run -d --read-only \
  --cap-drop ALL --security-opt no-new-privileges \
  --tmpfs /run/nut:uid=65532,gid=65532,mode=0750 \
  -v ./nut:/etc/nut:ro \
  -p 3493:3493 \
  hlhd/nut

USB: pass the device and a group that can open it, e.g. --device /dev/bus/usb/001/004 --group-add $(stat -c %g /dev/bus/usb/001/004).

⁠Configuration
Path
/etc/nut/ups.confDriver and device
/etc/nut/upsd.confLISTEN 0.0.0.0 3493
/etc/nut/upsd.usersClient accounts and their instcmds
/etc/nut/upsmon.confOptional; enables upsmon
/run/nutWritable, owned by 65532 (state sockets)
⁠Build

From the repository root:

docker build -t hlhd/nut .

⁠Image Contents

alpine 3.24.2

autoconf automake g++ gcc git libcrypto3 libssl3 libtool libusb libusb-dev make musl-dev neon neon-dev net-snmp-dev net-snmp-libs openssl-dev perl pkgconf

⁠Upstream Documentation

NUT's own documentation is README.adoc⁠, INSTALL.nut.adoc⁠ and networkupstools.org⁠.

Tag summary

Content type

Image

Digest

sha256:d69ae15ac…

Size

13.8 MB

Last updated

13 days ago

docker pull hlhd/nut