Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' as of 2024-06-15 into FTY
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jun 15, 2024
2 parents c405cec + dc099e8 commit d7412cb
Show file tree
Hide file tree
Showing 23 changed files with 2,411 additions and 130 deletions.
45 changes: 36 additions & 9 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ https://github.com/networkupstools/nut/milestone/11
* Addition of "NUT Simulated devices" support to `nut-scanner` in v2.8.2
broke detection of (in-)ability to find and query "Old NUT" servers via
`libupsclient.so` (internal flag got always enabled). [#2246]
* A fix for `upsmon` v2.8.1 setting of `OFFDURATION` [PR #2108, issue #2104,
revisiting PR #2055, issue #2044] was overly zealous and impacted also
the `OB` state in cases where communications to the data server were
severed and `DEADTIME` setting was not honored. [PR #2462, issue #2454]
- drivers, upsd, upsmon: reduce "scary noise" about failure to `fopen()`
- drivers, `upsd`, `upsmon`: reduce "scary noise" about failure to `fopen()`
the PID file (which most of the time means that no previous instance of
the daemon was running to potentially conflict with), especially useless
since in recent NUT releases the verdicts from `sendsignal*()` methods
Expand Down Expand Up @@ -87,6 +91,10 @@ https://github.com/networkupstools/nut/milestone/11
string values reported by devices via USB are welcome), so these devices
would now report `battery.voltage` and `battery.voltage.nominal`. [#2380]
- bicker_ser: added new driver for Bicker 12/24Vdc UPS via RS-232 serial
communication protocol, which supports any UPS shipped with the PSZ-1053
extension module. [PR #2448]
- USB drivers could log `(nut_)libusb_get_string: Success` due to either
reading an empty string or getting a success code `0` from libusb.
This difference should now be better logged, and not into syslog. [#2399]
Expand Down Expand Up @@ -116,10 +124,33 @@ https://github.com/networkupstools/nut/milestone/11
exiting (and/or start-up has aborted due to configuration or run-time
issues). Warning about "world readable" files clarified. [#2417]
- common code: root-owned daemons now use not the hard-coded `PIDPATH` value
set by the `configure` script during build, but can override it with a
`NUT_PIDPATH` environment variable in certain use-cases (such as tests).
[#2407]
- common code:
* introduced a `NUT_DEBUG_SYSLOG` environment variable to tweak activation
of syslog message emission (and related detachment of `stderr` when
backgrounding), primarily useful for NIT and perhaps systemd. Most
methods relied on logging bits being set, so this change aims to be
minimally invasive to impact setting of those bits (or not) in the
first place. [#2394]
* `root`-owned daemons now use not the hard-coded `PIDPATH` value set
by the `configure` script during build, but can override it with a
`NUT_PIDPATH` environment variable in certain use-cases (such as
tests). [#2407]
* introduced a check for daemons working with PID files to double-check
that if they can resolve the program name of a running process with
this identifier, that such name matches the current program (avoid
failures to start NUT daemons if PID files are on persistent storage,
and some unrelated program got that PID after a reboot). This might
introduce regressions for heavily customized NUT builds (e.g. those
embedded in NAS or similar devices) where binary file names differ
significantly from a `progname` string defined in the respective NUT
source file, so a boolean `NUT_IGNORE_CHECKPROCNAME` environment
variable support was added to optionally disable this verification.
Also the NUT daemons should request to double-check against their
run-time process name (if it can be detected). [issue #2463]
- various recipe, documentation and source files were revised to address
respective warnings issued by the new generations of analysis tools.
[#823, #2437, link:https://github.com/networkupstools/nut-website/issues/52[nut-website issue #52]]
- revised `nut.exe` (the NUT for Windows wrapper for all-in-one service)
to be more helpful with command-line use (report that it failed to start
Expand All @@ -142,10 +173,6 @@ https://github.com/networkupstools/nut/milestone/11
of more complex configurations (e.g. some line patterns that involve too
many double-quote characters) which are valid for NUT proper. [#657]
- various recipe, documentation and source files were revised to address
respective warnings issued by the new generations of analysis tools.
[#823, #2437, link:https://github.com/networkupstools/nut-website/issues/52[nut-website issue #52]]
Release notes for NUT 2.8.2 - what's new since 2.8.1
----------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ which the larger potential sponsors consider when choosing how to help
FOSS projects. Keeping the lights shining in such a large non-regression
build matrix is a big undertaking!
image:https://api.star-history.com/svg?repos=networkupstools/nut&type=Date[link="https://star-history.com/#networkupstools/nut&Date" alt="Star History Chart"]
See <<acknowledgements-ci-ops,acknowledgements of organizations which help
with NUT CI and other daily operations>> for an overview of the shared effort.
=====
Expand Down
16 changes: 16 additions & 0 deletions UPGRADING.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ Changes from 2.8.2 to 2.8.3
pages which are delivered automatically. Packaging recipes can likely
be simplified now. [#2445]
- Internal API change for `sendsignalpid()` and `sendsignalfn()` methods,
which can impact NUT forks which build using `libcommon.la` and similar
libraries. Added new last argument with `const char *progname` (may be
`NULL`) to check that we are signalling an expected program name when we
work with a PID. With the same effort, NUT programs which deal with PID
files to send signals (`upsd`, `upsmon`, drivers and `upsdrvctl`) would
now default to a safety precaution -- checking that the running process
with that PID has the expected program name (on platforms where we can
determine one). This might introduce regressions for heavily customized
NUT builds (e.g. embedded in NAS or similar devices) whose binary file
names differ significantly from a `progname` defined in the respective
NUT source file, so a boolean `NUT_IGNORE_CHECKPROCNAME` environment
variable support was added to optionally disable this verification.
Also the NUT daemons should request to double-check against their
run-time process name (if it can be detected). [issue #2463]
Changes from 2.8.1 to 2.8.2
---------------------------
Expand Down
18 changes: 12 additions & 6 deletions clients/upsmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,11 +1113,17 @@ static int is_ups_critical(utype_t *ups)
}

if (ups->linestate == 0) {
upslogx(LOG_WARNING,
/* Just a message for post-mortem troubleshooting:
* no flag flips, no return values issued just here
* (note the message is likely to appear on every
* cycle when the communications are down, to help
* track when this was the case; no log throttling).
*/
upsdebugx(1,
"UPS [%s] was last known to be not fully online "
"and currently is not communicating, assuming dead",
"and currently is not communicating, just so you "
"know (waiting for DEADTIME to elapse)",
ups->sys);
return 1;
}
}

Expand Down Expand Up @@ -3016,15 +3022,15 @@ int main(int argc, char *argv[])
* is running by sending signal '0' (i.e. 'kill <pid> 0' equivalent)
*/
if (oldpid < 0) {
cmdret = sendsignal(prog, cmd);
cmdret = sendsignal(prog, cmd, 1);
} else {
cmdret = sendsignalpid(oldpid, cmd);
cmdret = sendsignalpid(oldpid, cmd, prog, 1);
}

#else /* WIN32 */
if (cmd) {
/* Command the running daemon, it should be there */
cmdret = sendsignal(UPSMON_PIPE_NAME, cmd);
cmdret = sendsignal(UPSMON_PIPE_NAME, cmd, 1);
} else {
/* Starting new daemon, check for competition */
mutex = CreateMutex(NULL, TRUE, UPSMON_PIPE_NAME);
Expand Down
4 changes: 2 additions & 2 deletions common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ endif HAVE_WINDOWS

# ensure inclusion of local implementation of missing systems functions
# using LTLIBOBJS. Refer to configure.in/.ac -> AC_REPLACE_FUNCS
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@ @NETLIBS@
libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@ @NETLIBS@
libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@ @NETLIBS@ @BSDKVMPROCLIBS@
libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@ @NETLIBS@ @BSDKVMPROCLIBS@

libcommon_la_CFLAGS = $(AM_CFLAGS)
libcommonclient_la_CFLAGS = $(AM_CFLAGS)
Expand Down
Loading

0 comments on commit d7412cb

Please sign in to comment.