-
-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dummy-ups: relax error handling to prevent premature driver termination #2132
dummy-ups: relax error handling to prevent premature driver termination #2132
Conversation
Seems useful, thanks. I just wonder if for the sake of a principle of least surprise, this behavior should be an option (e.g. some The early driver-startup aborts became less of a problem on systems with systemd or SMF, where the dead driver would be retried (and each has its dedicated service instance, so less of a use-case for one Another common hiccup with On a note that seems related - before NUT v2.8.0 release, |
A linger flag sounds like a sensible solution, but we're talking driver-specific, right? I think that'd make the most sense. So basically when linger is enabled the driver emits the errors at startup but doesn't make them fatal, unless they are really fatal errors. Default behavior we keep at driver termination on any error at repeater startup as to not break existing workarounds. If I got that all right, I'll get right on it. |
Yep, like that and just for this driver (well, maybe later would also jump into Also as this is a notable behavior change, it warrants a driver version bump, as well as notes in |
… termination Signed-off-by: desertwitch <[email protected]>
…eater_disable_strict_start config option Signed-off-by: desertwitch <[email protected]>
I hope this looks good to you and implements the changes as discussed. 👍 |
…option Signed-off-by: desertwitch <[email protected]>
Thanks! Merged :) |
This presents a possible follow up for the useful revisions of #2118.
It is currently not possible to utilize the
dummy-ups
driver's repeater function within a local multi-UPSups.conf
file, particularly havingupsdrvctl
collectively start all drivers via e.g./usr/sbin/upsdrvctl -u root start
or within a systemd environment.The reason for this is that the
dummy-ups
driver at present terminates prematurely upon encountering any kind of error at repeater mode startup, in particular a connectivity one due to the driver it should repeat not being 100% up yet orupsd
not being up yet - as encountered during collectiveupsdrvctl
startup. This proceeds to raise an erroneous return code fromupsdrvctl
(Driver failed to start (exit status=1)
) possibly breaking the user's entire NUT startup depending on their service scripts.Such a configuration would - at present - require to first start
ups
and afterwardsqnapups
via individual command.It is a configuration commonly used by users with QNAP, Synology etc. devices which require certain UPS names to function.
The current error handling in
dummy-ups
complicates such a setup and could also pose a theoretical problem in a networked NUT environment when e.g. a NUT installation is restarted after a reboot (due to a power loss situation). When the server comes back up and starts NUT, but individual network devices (switches, ...) have not recovered yet, adummy-ups
driver will terminate encountering the temporary (but later recovered from) connectivity problem.I therefore propose the following changes, as I believe that we could allow
dummy-ups
to attempt to recover from any such not-necessarily fatal errors (with the fatal ones already specifically defined and causing driver termination - such as too old upsd, bad configuration etc.). While the user would still be notified of the errors occurring, the driver would not terminate in such a situation.In general I assume most users utilizing
dummy-ups
to have to a degree RTFM and also bring enough technical proficiency to read and understand the error messages in the log if they see theirdummy-ups
setup not working as expected.Here's such an example configuration and respective log from my testing system with a SNMP driver and a
dummy-ups
repeater configured locally and invoked via/usr/sbin/upsdrvctl -u root start
: