Skip to content

Teach upsdrvctl and drivers to talk socket protocol to their other selves#1922

Merged
jimklimov merged 62 commits intonetworkupstools:masterfrom
jimklimov:issue-1285-upsdrvquery
Apr 24, 2023
Merged

Teach upsdrvctl and drivers to talk socket protocol to their other selves#1922
jimklimov merged 62 commits intonetworkupstools:masterfrom
jimklimov:issue-1285-upsdrvquery

Conversation

@jimklimov
Copy link
Member

@jimklimov jimklimov commented Apr 22, 2023

As a follow-up to issue #1903, PR #1918 and discussion #1920, this PR adds a limited socket-protocol client to drivers (main.c) and upsdrvctl, so they can request reload-or-error on command-line to query the running instance of the driver. If it fails to reload some changed values, exit-code 2 can be seen (technically STAT_INSTCMD_INVALID), so e.g. nut-driver-enumerator can disable and redefine the service carefully.

…oduce NUT_DEBUG_LEVEL envvar support (if no "-D" option(s) among CLI args) [networkupstools#1915]

Closes: networkupstools#1915
…ka DRIVERS_MAIN_WITHOUT_MAIN now that it is referenced in main_setvar() [networkupstools#1903, networkupstools#1285]
…of string: satisfy platforms where snprintf is a macro [networkupstools#1914]
…eparation of string: satisfy platforms where snprintf is a macro [networkupstools#1914]
…est(upslog_flags, UPSLOG_STDERR) at all, not just that the debug is enabled; also mark upslog_start when we first call the method, even if debu is not currently verbose (may change at run time) [networkupstools#1903]
…ka DRIVERS_MAIN_WITHOUT_MAIN now that it is referenced in main_setvar()=>assign_debug_level() [networkupstools#1903, networkupstools#1285]
@jimklimov jimklimov force-pushed the issue-1285-upsdrvquery branch from 887d27a to 3b1ae65 Compare April 23, 2023 23:14
@jimklimov jimklimov merged commit 0acd95f into networkupstools:master Apr 24, 2023
@jimklimov jimklimov deleted the issue-1285-upsdrvquery branch April 24, 2023 09:56
jimklimov added a commit to jimklimov/nut that referenced this pull request Jun 30, 2023
]

Follow-up after core driver changes (main.c etc.) with `driver.state` networkupstools#1767,
driver reload command networkupstools#1903, driver inter-instance communications via socket networkupstools#1922
and others.

Also convert remaining single-digit X.Y versions to X.<Y+1>0 double-digits.
jimklimov added a commit to jimklimov/nut that referenced this pull request Dec 2, 2024
…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]>
jimklimov added a commit to jimklimov/nut that referenced this pull request Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature NUT protocols service/daemon start/stop General subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants