I'm working on some fixes for NUT (Network UPS Tools ) on OpenWrt and would welcome additional testers. This current round is about fixing the fact that NUT has not been properly restarting on config changes (e.g. in LuCI, or with /etc/init.d/nut reload) and was not reloading and stopping cleanly.
The PR on openwrt/packages is this one:
master โ danielfdickinson:pr-nut-fix-reload-on-change
opened 03:33AM - 19 Jan 26 UTC
## ๐ฆ Package Details
**Maintainer:** @hnyman @s-hamann @drujd @tofurky @nehebโฆ @BKPepe @systemcrash @rpavlik
No maintainer, so spamming last 2.x years worth of folks who may be interested.
**Description:**
Updated configuration was not being applied after config change. This
was due to the means used to do the daemon reloads.
Closes https://github.com/openwrt/packages/issues/28298 "Drivers not restarted on config change"
Enable creating PID files for the server, driver, and monitor daemon
processes. This allows to use NUT's built-in facilities for signalling
the daemon's.
For server, when reloading:
1. Check if upsd is running
1. If not, start it.
2. If it is send reload signal to upsd
2. For each driver:
1. Check if the driver is running
1. If it is, send reload-or-exit signal to driver
2. If driver is not running, start it
3. Attempt to start server (upsd and drivers) if service was stopped.
For server, when stopping:
1. Check if upsd is running
1. If it is send stop signal to upsd
2. Ensure it really is stopped
2. For each driver:
1. Check if the driver is running
1. If it is, send stop signal to driver
2. If driver is still running, stop it.
3. If the server process is active (even with not upsd or drivers),
stop it.
For monitor, send the reload signal on config change, with fallback to
stopping and starting the daemon.
In the process added linting (ignoring false positives) and fixed whitespace inconsistency.
---
## ๐งช Run Testing Details
- **OpenWrt Version:** OpenWrt SNAPSHOT r32673-9d1f6ec49d
- **OpenWrt Target/Subtarget:** bcm27xx/bcm2712
- **OpenWrt Device:** aspberrypi,5-model-b
Only tested with dummy-ups so far. I have a spare UPS on order which should arrive this coming week.
Needs more testing and review.
---
## โ
Formalities
- [x] I have reviewed the [CONTRIBUTING.md](https://github.com/openwrt/packages/blob/master/CONTRIBUTING.md) file for detailed contributing guidelines.
Thank you in advance for anyone who helps.