Introduce sdcommands option and shutdown.default INSTCMD to all drivers#2686
Introduce sdcommands option and shutdown.default INSTCMD to all drivers#2686jimklimov merged 97 commits intonetworkupstools:masterfrom
sdcommands option and shutdown.default INSTCMD to all drivers#2686Conversation
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]>
…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]>
|
✅ Build nut 2.8.2.2454-master completed (commit c44c15765c by @jimklimov) |
|
Per #2670 (comment) real-life testing succeeded with
|
|
Also checked with Note the drivers do not exit now due to INSTCMD alone (because It does however set the flag and exit when we "kill power" using
|
…handler" [networkupstools#2686] Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
…a debug message about its limited usefullness Signed-off-by: Jim Klimov <[email protected]>
Signed-off-by: Jim Klimov <[email protected]>
|
Sandboxing helped find some issues with So both copies of the driver program met, talked, and exited (with the daemon handling shutdown the best it could - no-op - and raising the exit flag). |
…vate use of timeval={-1,-1} as select(..., NULL) for indefinite wait [networkupstools#1922, networkupstools#2392, networkupstools#2686]
Signed-off-by: Jim Klimov <[email protected]>
…vate use of timeval={-1,-1} as select(..., NULL) for indefinite wait [networkupstools#1922, networkupstools#2392, networkupstools#2686, networkupstools#2670]
Signed-off-by: Jim Klimov <[email protected]>
…, let it be known to the TRACKING clients [networkupstools#2686] Signed-off-by: Jim Klimov <[email protected]>
…, let it be known to the TRACKING clients [networkupstools#656, networkupstools#2686] Signed-off-by: Jim Klimov <[email protected]>
…, let it be known to the TRACKING clients [networkupstools#2686] Signed-off-by: Jim Klimov <[email protected]>
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)
sdcommandsoption 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.defaultfor good measure (similar todriver.killpowerbut 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.returnorshutdown.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).