NUT upsd fails to start on boot-up when configured to use APCUPSD-Driver
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:
- [ x ] I have read the contributing guidelines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- [ x ] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
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:
- Go to 'Services'
- Click on 'Apcupsd'
- Click on 'Settings'
- Configure 'Apcupsd' accordingly
- Click on 'Apply'
- Go to 'Services'
- Click on 'Apcupsd'
- Click on 'Status' - verify expected status information.
- Go to 'Services'
- Click on 'Nut'
- Click on 'Configuration'
- Click on 'UPS Type' tab
- Select 'APCUPSD-Driver'
- Click on 'Enable'
- Ensure Hostname is set to 'localhost'
- Click on 'Apply'
- Click on 'General Settings' tab
- Click on 'Enable nut'
- Click on 'Service Mode' and select 'standalone'
- Click in 'Name' field and enter a name
- Click on 'Apply'
- Go to 'Services'
- Click on 'Nut'
- Click on 'Diagnostics' - verify UPS information is presented
- Reboot OPNsense
- Observe NUT upsdrvctl throw error advising it cant communicate with apcupds.
- 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.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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