Skip to content

Commit

Permalink
Merge branch 'master' into issue-1767
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov authored Jan 8, 2023
2 parents 0a0c941 + dca135c commit 6802a80
Show file tree
Hide file tree
Showing 40 changed files with 1,078 additions and 64 deletions.
18 changes: 18 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,21 @@
The Perl client module (scripts/perl/Nut.pm) is released under the same
license as Perl itself. That is to say either GPL version 1 or (at your option)
any later version, or the "Artistic License".

Several fallback implementations for methods absent from standard library of
an end-user's current build platform are derived from source code available
under the two-clause BSD license (common/strptime.c, common/strnlen.c)

Various methods may be adapted from code or ideas posted on Stack Exchange
sites (comments in NUT sources refer to original posts in this case), which
according to https://stackoverflow.com/help/licensing are made available under
different Creative Commons Attribution-ShareAlike license (CC BY-SA) versions
depending on contribution timestamp.

Several autoconf methods under m4/ directory are derived from curl codebase
and were originally available under curl license. Which is not unlike the MIT
license, see https://daniel.haxx.se/blog/2022/06/17/curl-is-reuse-compliant/

To the best of our knowledge, conditions of the 2/3-clause BSD, MIT, curl and
CC BY-SA licenses allow redistribution and reuse of the codebase in projects
made available under GPL license terms, as long as attribution is provided.
4 changes: 4 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ P: Arnaud Quette
M: [email protected]
S: Maintained: Official Debian packages

P: Greg Troxel
M: [email protected]
S: Maintained: pkgsrc (sysutils/ups-nut)

Everything else
===============

Expand Down
29 changes: 22 additions & 7 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ https://github.com/networkupstools/nut/milestone/8
of all USB drivers using these options to include the same description
[#1766]

- Added an `allow_duplicates` flag for common USB matching options which
may help monitor several related no-name devices (although without knowing
reliably which one is which... better than nothing) [#1756]

- Stuck drivers that do not react to `SIGTERM` quickly are now retried with
`SIGKILL` [#1424]

Expand All @@ -154,30 +158,30 @@ https://github.com/networkupstools/nut/milestone/8
this variable unless troubleshooting, although other systems rely on it)
[#805]

- the nut-scanner program was updated to fall back to loading unresolved
- The nut-scanner program was updated to fall back to loading unresolved
library filenames, hoping that `lt_dlopen()` implementation on the current
platform would find library files better [#805]

- detection of `libltdl` in `configure` script updated with fallback code to
- Detection of `libltdl` in `configure` script updated with fallback code to
find it on systems that deliver the library to `/usr/local/lib` (e.g. on
FreeBSD) [#1577]

- an explicit `configure --with-nut-scanner` toggle was added, specifically
- An explicit `configure --with-nut-scanner` toggle was added, specifically
so that build environments requesting `--with-all` but lack `libltdl` would
abort and require either to install the dependency or explicitly forfeit
the tool (some distro packages missed it quietly in the past) [#1560]

- existing openssl-1.1.0 support added for NUT v2.8.0 release was tested to
- Existing openssl-1.1.0 support added for NUT v2.8.0 release was tested to
be sufficient without deprecation warnings for builds against openssl-3.0.x
(but no real-time testing was done yet) [#1547]

- upslog: Added support for logging multiple devices with one call to the
program [#1604]

- some fixes applied to Solaris/illumos packaging and SMF service support
- Some fixes applied to Solaris/illumos packaging and SMF service support
[#1554, #1564]

- some fixes for builds on older OSes with less functional default system
- Some fixes for builds on older OSes with less functional default system
shell interpreters - now `autogen.sh` supports a `CONFIG_SHELL` envvar
to inject its value into generated `configure` script [#1736]
* Note that you may have to install additional tools (possibly from
Expand Down Expand Up @@ -219,14 +223,25 @@ https://github.com/networkupstools/nut/milestone/8
- Several fixes for `upsmon` behavior [#1761, #1680...], including new
ability to configure default POWERDOWNFLAG location -- packagers are
encouraged to pick optimal location for their distributions (which
remains mounted at least read-only late in shutdown) [#529]
remains mounted at least read-only late in shutdown) and a new optional
POLLFAIL_LOG_THROTTLE_MAX setting [#529, #506]

- Extended Linux systemd support with optional notifications about daemon
state (READY, RELOADING, STOPPING) and watchdog keep-alive messages [#1590]

- Extended Linux systemd units with aliases named after the daemons:
`nut-server.service` as `upsd.service`, and `nut-monitor.service` as
`upsmon.service` (so simple `systemctl reload upsd` can work) [#1777]

- Further revision of public headers delivered by NUT was done, particularly
to address lack of common data types (`size_t`, `ssize_t`, `uint16_t`,
`time_t` etc.) in third-party client code that earlier sufficed to only
include NUT headers. Sort of regression by NUT 2.8.0 (note those consumers
still have to re-declare some numeric variable types used) [#1638, #1615]

- The `COPYING` file was updated with licenses and attribution for certain
source code files and blocks coming from the Internet originally [#1758]

---------------------------------------------------------------------------
Release notes for NUT 2.8.0 - what's new since 2.7.4:

Expand Down
9 changes: 8 additions & 1 deletion UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Changes from 2.8.0 to 2.8.1
serial drivers in respective Makefile and configure script options - this
may impact packaging decisions on some distributions going forward [#1446]

- an explicit `configure --with-nut-scanner` toggle was added, specifically
- An explicit `configure --with-nut-scanner` toggle was added, specifically
so that build environments requesting `--with-all` but lacking `libltdl`
would abort and require the packager either to install the dependency
or explicitly forfeit building the tool (some distro packages missed it
Expand All @@ -66,6 +66,13 @@ Changes from 2.8.0 to 2.8.1
* Several other issues have been fixed related to this file and its content,
including #1030, #1037, #1117 and #1712

- Extended Linux systemd support with optional notifications about daemon
state (READY, RELOADING, STOPPING) and watchdog keep-alive messages.
Note that `WatchdogSec=` values are currently NOT pre-set into systemd
unit file templates provided by NUT, this is an exercise for end-users
based on sizing of their deployments and performance of monitoring station
[#1590, #1777]

- snmp-ups: some subdrivers (addressed using the driver parameter `mibs`)
were renamed: `pw` is now `eaton_pw_nm2`, and `pxgx_ups` is `eaton_pxg_ups`
[#1715]
Expand Down
2 changes: 2 additions & 0 deletions clients/upsclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ int upscli_ssl(UPSCONN_t *ups);

/* upsclient error list */

#define UPSCLI_ERR_NONE -1 /* No known error (internally used in tools like upsmon, not set by upsclient.c) */

#define UPSCLI_ERR_UNKNOWN 0 /* Unknown error */
#define UPSCLI_ERR_VARNOTSUPP 1 /* Variable not supported by UPS */
#define UPSCLI_ERR_NOSUCHHOST 2 /* No such host */
Expand Down
8 changes: 8 additions & 0 deletions clients/upslog.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,11 @@ int main(int argc, char **argv)

compile_format();

upsnotify(NOTIFY_STATE_READY_WITH_PID, NULL);

while (exit_flag == 0) {
upsnotify(NOTIFY_STATE_WATCHDOG, NULL);

time(&now);

if (nextpoll > now) {
Expand All @@ -631,10 +635,12 @@ int main(int argc, char **argv)
}

if (reopen_flag) {
upsnotify(NOTIFY_STATE_RELOADING, NULL);
upslogx(LOG_INFO, "Signal %d: reopening log file",
reopen_flag);
reopen_log();
reopen_flag = 0;
upsnotify(NOTIFY_STATE_READY, NULL);
}

for (monhost_ups_current = monhost_ups_anchor;
Expand All @@ -657,6 +663,8 @@ int main(int argc, char **argv)
}

upslogx(LOG_INFO, "Signal %d: exiting", exit_flag);
upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag);

for (monhost_ups_current = monhost_ups_anchor;
monhost_ups_current != NULL;
monhost_ups_current = monhost_ups_current->next) {
Expand Down
Loading

0 comments on commit 6802a80

Please sign in to comment.