opnsense / opnsense/plugins

NUT upsd fails to start on boot-up when configured to use APCUPSD-Driver

Open
#5,387 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

Enabled and configuring APCUPSD plug-in and verified UPS status.

Configured NUT to operate in STANDALONE mode and to use the APCUPSD-Driver.

Verified NUT's UPS status - OK.

Reboot OPNsense.

NUT upsd fails to start during boot-up and upsmon is unable to monitor the UPS until manual intervening by restarting the NUT service.

To Reproduce

Steps to reproduce the behaviour:

  1. Go to 'Services'
  2. Click on 'Apcupsd'
  3. Click on 'Settings'
  4. Configure 'Apcupsd' accordingly
  5. Click on 'Apply'
  6. Go to 'Services'
  7. Click on 'Apcupsd'
  8. Click on 'Status' - verify expected status information.
  9. Go to 'Services'
  10. Click on 'Nut'
  11. Click on 'Configuration'
  12. Click on 'UPS Type' tab
  13. Select 'APCUPSD-Driver'
  14. Click on 'Enable'
  15. Ensure Hostname is set to 'localhost'
  16. Click on 'Apply'
  17. Click on 'General Settings' tab
  18. Click on 'Enable nut'
  19. Click on 'Service Mode' and select 'standalone'
  20. Click in 'Name' field and enter a name
  21. Click on 'Apply'
  22. Go to 'Services'
  23. Click on 'Nut'
  24. Click on 'Diagnostics' - verify UPS information is presented
  25. Reboot OPNsense
  26. Observe NUT upsdrvctl throw error advising it cant communicate with apcupds.
  27. Observe apcpupsd starting after nut_upsmon has started

Expected behavior

When NUT upsdrvctl starts during boot-up, it should be able to communicate with apcupsd.

Describe alternatives you considered

None.

Screenshots

If applicable, add screenshots to help explain your problem.

Image

Relevant log files

<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal root 36907 - [meta sequenceId="369"] /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="370"] <118>[54] Network UPS Tools upsdrvctl - UPS driver controller 2.8.3 release
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="371"] <118>[54] Network UPS Tools 2.8.3 release - apcupsd network client UPS driver 0.73
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="372"] <118>[54] can't communicate with apcupsd!
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="373"] <118>[54] Driver failed to start (exit status=1)
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="374"] <118>[54] /usr/local/etc/rc.d/nut: WARNING: failed precmd routine for nut
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="375"] <118>[54] osrelayd is not running.
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="376"] <118>[54] Starting osrelayd.
<27>1 2026-04-08T23:21:26+08:00 vpn-gw.internal upsmon 64364 - [meta sequenceId="377"] UPS [SUA1000I]: connect failed: Connection failure: Connection refused
<29>1 2026-04-08T23:21:26+08:00 vpn-gw.internal upsmon 64364 - [meta sequenceId="378"] Communications with UPS SUA1000I lost
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="379"] <118>[54] Starting nut_upsmon.
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="380"] <118>[54] Network UPS Tools upsmon 2.8.3 release
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="381"] <118>[54] UPS: SUA1000I (primary) (power value 1)
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="382"] <118>[54] Using power down flag file /etc/killpower
<13>1 2026-04-08T23:21:26+08:00 vpn-gw.internal kernel - - [meta sequenceId="383"] <118>[54] Starting flowd_aggregate.
<13>1 2026-04-08T23:21:27+08:00 vpn-gw.internal kernel - - [meta sequenceId="384"] <118>[55] Starting apcupsd.
<13>1 2026-04-08T23:21:27+08:00 vpn-gw.internal flowd_aggregate.py 71494 - [meta sequenceId="385"] startup, check database.
<29>1 2026-04-08T23:21:27+08:00 vpn-gw.internal ftp-proxy 22383 - [meta sequenceId="386"] listening on 127.0.0.1 port 4559

Additional context

Please re-order service start-up so apcupsd is started and running prior to NUT.

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 26.1.5 (amd64).
Intel® Core(TM) i7-7700 CPU @ 3.60GHz (3600.00-MHz K8-class CPU)
Network Intel® I350

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the boot-time failure in /usr/local/etc/rc.d/nut and compare the startup ordering shown in the logs for nut, upsmon, and apcupsd. Trace the service configuration that controls these dependencies, then reboot with APCUPSD-Driver and standalone NUT enabled; done means apcupsd is running before NUT and the UPS is monitored without manual intervention.

Written by the indexing model from the issue text.

Assessment

Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.