Skip to content

nut-upsd: Add pollonly option to entrypoint script#265

Open
RyanGWU82 wants to merge 1 commit intoinstantlinux:mainfrom
RyanGWU82:nut-upsd/pollonly
Open

nut-upsd: Add pollonly option to entrypoint script#265
RyanGWU82 wants to merge 1 commit intoinstantlinux:mainfrom
RyanGWU82:nut-upsd/pollonly

Conversation

@RyanGWU82
Copy link

Summary of Changes

Adds a new optional environment variable, POLLONLY, to the Docker image for Network UPS Tools (NUT) . Following the same conventions as other options in the entrypoint script, when set, it appends pollonly to the generated ups.conf.

Closes #264.

Why is this change being made?

pollonly disables USB interrupt-based reads in favor of direct HID polling, and is particularly useful for CyberPower UPS devices whose HID implementations don't reliably send USB interrupt reports. Without it, the usbhid-ups driver stalls waiting for reports that never arrive, eventually marking data as stale and causing the UPS to appear offline.

How was this tested? How can the reviewer verify your testing?

Tested by building the image directly from the branch using a docker-compose.yml with:

  build:
    context: https://github.com/RyanGWU82/docker-tools.git#nut-upsd/pollonly:images/nut-upsd

To verify independently, a reviewer can build and run the container with POLLONLY set and inspect the generated config. The output should include pollonly in the [ups] block.

# Build a test image from my branch
docker build https://github.com/RyanGWU82/docker-tools.git#nut-upsd/pollonly:images/nut-upsd -t nut-upsd-test

# Start a container with POLLONLY set
docker run -d --name nut-upsd-test -e POLLONLY=1 nut-upsd-test

# Verify that pollonly appears in the generated ups.conf
docker exec nut-upsd-test cat /etc/nut/ups.conf

# Clean up
docker rm -f nut-upsd-test

Completion checklist

  • The pull request is linked to all related issues
  • This change has unit test coverage
  • Documentation has been updated
  • Dependencies have been updated and verified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nut-upsd: Add support for POLLONLY option

1 participant