Skip to content

Commit

Permalink
Merge pull request #2472 from jimklimov/FTY-remerge-20240615
Browse files Browse the repository at this point in the history
 FTY remerge from master as of 2024-06-15
  • Loading branch information
jimklimov authored Jun 26, 2024
2 parents c405cec + ac4208d commit 033ba47
Show file tree
Hide file tree
Showing 39 changed files with 2,561 additions and 221 deletions.
70 changes: 60 additions & 10 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ 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]
- drivers, upsd, upsmon: reduce "scary noise" about failure to `fopen()`
* 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]
* Using `drivername -c reload` (e.g. facilitated by `nut-driver-enumerator`
script and service when editing `ups.conf`) led to disconnected Unix
sockets and a tight polling loop that hogged CPU. While the underlying
bug is ancient, it took recent development to hit it as a practical
regression. [issue #1904, issue #2484]
- 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 +96,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 +129,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 @@ -133,6 +169,24 @@ https://github.com/networkupstools/nut/milestone/11
+
NOTE: The `html-chunked` documents are currently still not installed.
- added support to `./configure --with-doc=man=dist-auto` to use distributed
manual page files if present; only fall back to build them if we can. [#2473]
- added a `make distcheck-light-man` recipe to require verification that the
manual page files can be built using the prepared "tarball" archive. [#2473]
- added a `common/Makefile.am` build product for a new internal library
`libcommonstr.la` which allows a smaller selection of helper methods
for tools like `nut-scanner` which do not need the full `libcommon.la`
nor `libcommonclient.la`. [#2478, #2491]
- added a `drivers/Makefile.am` build product for a new internal library
`libserial-nutscan.la` to simplify `tools/nut-scanner/Makefile.am` recipes.
[#2490]
- build of `snmp-ups` and `netxml-ups` drivers now explicitly brings linker
dependency on chosen SSL libraries. [#2479]
- brought keyword dictionaries of `nutconf` and `augeas` NUT configuration
file parsers up to date; restored automated checks for `augeas` lenses.
[issue #657, issue #2294]
Expand All @@ -142,10 +196,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
2 changes: 1 addition & 1 deletion clients/nutclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#ifndef NUTCLIENT_HPP_SEEN
#define NUTCLIENT_HPP_SEEN
#define NUTCLIENT_HPP_SEEN 1

/* Begin of C++ nutclient library declaration */
#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions clients/nutclientmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#ifndef NUTCLIENTMEM_HPP_SEEN
#define NUTCLIENTMEM_HPP_SEEN
#define NUTCLIENTMEM_HPP_SEEN 1

/* Begin of C++ nutclient library declaration */
#ifdef __cplusplus
Expand Down Expand Up @@ -117,4 +117,4 @@ NUTCLIENT_MEM_t nutclient_mem_create_client();
#endif /* __cplusplus */
/* End of C nutclient library declaration */

#endif /* NUTCLIENTMOCK_HPP_SEEN */
#endif /* NUTCLIENTMEM_HPP_SEEN */
6 changes: 5 additions & 1 deletion clients/upsclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

#ifndef UPSCLIENT_H_SEEN
#define UPSCLIENT_H_SEEN
#define UPSCLIENT_H_SEEN 1

#ifdef WITH_OPENSSL
#include <openssl/err.h>
Expand Down Expand Up @@ -53,6 +53,10 @@
# endif
#endif

#if defined HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
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
6 changes: 3 additions & 3 deletions common/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ libcommonclient_la_SOURCES = state.c str.c
noinst_LTLIBRARIES += libcommonstr.la
libcommonstr_la_SOURCES = str.c
libcommonstr_la_CFLAGS = $(AM_CFLAGS) -DWITHOUT_LIBSYSTEMD=1
libcommonstr_la_LIBADD = @LTLIBOBJS@
libcommonstr_la_LIBADD = @LTLIBOBJS@ @BSDKVMPROCLIBS@

if BUILDING_IN_TREE
libcommon_la_SOURCES += common.c
Expand Down 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 033ba47

Please sign in to comment.