-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
Introduce sdcommands
option and shutdown.default
INSTCMD to all drivers
#2686
Open
jimklimov
wants to merge
87
commits into
networkupstools:master
Choose a base branch
from
jimklimov:issue-2670
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,583
−470
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
…t all [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…rom upsdrv_shutdown() to upscmd("shutdown.stayoff") [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…er) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…user) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…ser) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…rv_shutdown() to upscmd("shutdown.return") [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…r); revise warning message [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…sdrv_shutdown() to upscmd("shutdown.return"); newly support INSTCMD at all [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…m upsdrv_shutdown() to upscmd("shutdown.return") [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…m upsdrv_shutdown() to upscmd("shutdown.return"); newly support INSTCMD at all [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…er) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…user) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…r) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…rv_shutdown() to upscmd("shutdown.return") [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…upsdrv_shutdown() to upscmd("shutdown.return"); newly support INSTCMD at all [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
…zed by user) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…rom upsdrv_shutdown() to upscmd("shutdown.stayoff") [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…er) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…y user) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…user) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…r) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
… user) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…ser) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…er) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…er), by default chain the originally used sequence in upsdrv_shutdown() [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…XIT_FAILURE and EF_EXIT_SUCCESS for set_exit_flag(int) methods [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…s for set_exit_flag(int) methods [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…rv_shutdown flag to exit or not after upsdrv_shutdown() and individual power-state related INSTCMDs [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…ver [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…tcmd() [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…t and upsdrv_shutdown_default() shared method [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
… upsdrv_shutdown() in any driver [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…efault" support [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…wn_sdcommands_or_default() less ambiguously [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…default upsdrv_shutdown() as the implementation of forceshutdown() and "driver.killpower" INSTCMD (e.g. via `drivername -k`) [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…() so drivers might implement their own "shutdown.default" at will [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…wn_commands() [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
…lt" implementations again [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…tinfo() where we register INSTCMD handlers [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
…fallback() so drivers might implement their own "shutdown.default" at will [networkupstools#2670]" This reverts commit 25250b0: too messy in logs where driver.instcmd() think they are last in stack. Signed-off-by: Jim Klimov <[email protected]>
…" as upsdrv_shutdown() in main loop too [networkupstools#2670] Signed-off-by: Jim Klimov <[email protected]>
jimklimov
added
feature
need testing
Code looks reasonable, but the feature would better be tested against hardware or OSes
service/daemon start/stop
General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug
Shutdowns and overrides and battery level triggers
Issues and PRs about system shutdown, especially if battery charge/runtime remaining is involved
labels
Nov 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
feature
need testing
Code looks reasonable, but the feature would better be tested against hardware or OSes
service/daemon start/stop
General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug
Shutdowns and overrides and battery level triggers
Issues and PRs about system shutdown, especially if battery charge/runtime remaining is involved
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #2670
Started from discussion in the issue linked above, about drivers hard-coding some operations as their late-shutdown implementation -- which may not be the best fit for a particular supported device model.
This PR aims to allow one to configure (a generally comma-separated list of)
sdcommands
option with arbitrary INSTCMD values supported by the device-specific part of driver code (if any). In testing e.g. beeper commands can be used instead of powering off the load.It also aliases the call to
upsdrv_shutdown()
as ashutdown.default
for good measure (similar todriver.killpower
but without a failsafe flag, and not necessarily exiting the driver).Shutdown implementations of some drivers got reshuffled into newly supported standard instant commands like
shutdown.return
orshutdown.stayoff
- sometimes guessing the name (testing wanted). For others, the method code remains unique (e.g. when return/stayoff is chosen based on OL/OB status).