Compare commits

...
Sign in to create a new pull request.

131 commits

Author SHA1 Message Date
Orion Poplawski
98284f631b Add missing || : to preinstall scriptlet (rhbz#241964) 2025-12-05 18:34:11 -07:00
Michal Hlavinka
77706a32be based on PR#18 by Orion Poplawski
Build NUT-Monitor and ship in separate nut-monitor package (rhbz#2359149)
Move UPS drivers into /usr/libexec/nut
2025-09-30 12:11:02 +02:00
Python Maint
069b76a3a8 Rebuilt for Python 3.14.0rc3 bytecode 2025-09-19 12:33:37 +02:00
Python Maint
7164fc2d6d Rebuilt for Python 3.14.0rc2 bytecode 2025-08-15 13:02:57 +02:00
Michal Hlavinka
4870df85c6 updated to 2.8.4 (#2387244) 2025-08-14 12:13:59 +02:00
Fedora Release Engineering
cc9daebf1e Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 23:02:13 +00:00
Python Maint
38f34fb51d Rebuilt for Python 3.14 2025-06-02 19:58:22 +02:00
Michal Hlavinka
1f502ae93a rename rhino to nutdrv_rhino to prevent file conflict (rhbz#2367057) 2025-05-21 13:43:14 +02:00
Michal Hlavinka
9867e18241 add needed buildrequire jq 2025-04-29 17:37:37 +02:00
Michal Hlavinka
760ad72a05 updated to 2.8.3 (#2352734) 2025-04-29 16:46:04 +02:00
Zbigniew Jędrzejewski-Szmek
91e5a19370 Add sysusers.d config file to allow rpm to create users/groups automatically
See https://fedoraproject.org/wiki/Changes/RPMSuportForSystemdSysusers.

-cgi requires -client, so it doesn't need it's copy of the file.

setup Provides group(dialout) and group(tty), but let's add the Requires
for clarity.
2025-02-11 16:33:00 +01:00
Michal Hlavinka
ce21c14155 add back git snapshot part of release number 2025-01-31 21:00:34 +01:00
Michal Hlavinka
7d3c0ad65d fix ftbfs, make it build with unified bin/sbin
fix ftbfs, make it build with unified bin/sbin
fix ftbfs, make it build with unified bin/sbin
fix ftbfs, make it build with unified bin/sbin
fix ftbfs, make it build with unified bin/sbin
2025-01-29 00:09:31 +01:00
Fedora Release Engineering
b278271309 Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 20:31:55 +00:00
Orion Poplawski
3cb725a9a6 Add BR systemd-devel to enable systemd notification support 2024-11-15 16:08:05 -07:00
Fedora Release Engineering
02a191e840 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 19:52:32 +00:00
Michal Hlavinka
810e8f234e fix python FTBFS, uses git snapshot as of 20240703 with PR 2505 2024-07-03 12:59:09 +02:00
Python Maint
59f9744317 Rebuilt for Python 3.13 2024-06-07 08:33:13 +02:00
Michal Hlavinka
ada5bd73a7 updated to 2.8.2(2272586) 2024-04-03 11:56:12 +02:00
Fedora Release Engineering
17e960e140 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-25 09:32:03 +00:00
Fedora Release Engineering
03a2bff29b Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-21 10:02:08 +00:00
Michal Hlavinka
9b811d0688 fix gpio check conditions 2023-12-06 12:29:26 +01:00
Orion Poplawski
0089d11277 Re-add nut.target to nut-client (bz#2156504) 2023-11-30 11:52:01 -07:00
Michal Hlavinka
f74346c47d libgpiod v2 is not compatible, disable for now 2023-11-02 11:55:02 +01:00
Michal Hlavinka
182c96a020 updated to 2.8.1(2247337) 2023-11-01 22:31:34 +01:00
Michal Hlavinka
f9d1f583d7 spec cleanup, based on PR#14 by Orion Poplawski 2023-10-10 00:11:39 +02:00
Fedora Release Engineering
2572132723 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 17:01:05 +00:00
Orion Poplawski
d4f6d893fc Drop BR on /usr/bin/pathfix.py 2023-06-14 20:56:01 -06:00
Python Maint
ea13be436a Rebuilt for Python 3.12 2023-06-13 20:23:11 +02:00
Michal Hlavinka
d7132ee907 use new patch macro format, with epel compatibility 2023-05-03 12:26:49 +02:00
Michal Hlavinka
64fdb72282 update license tag format (SPDX migration) for https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_1 2023-04-26 10:57:21 +02:00
Michal Hlavinka
dc7efebac0 add nut-xml to nut recommends (#2151810) 2023-02-14 22:19:17 +01:00
Fedora Release Engineering
aad68762c3 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 21:54:34 +00:00
Michal Hlavinka
8debbe8226 move upslog to nut-client, some small spec file changes (#2156504) 2023-01-04 13:12:09 +01:00
Michal Hlavinka
4daa893965 use https for urls 2022-12-06 22:31:17 +01:00
Charles R. Anderson
0a29e563e3 Fix STATEPATH/PIDPATH/ALTPIDPATH directory creation and ownership
use piddir for specifying restart_flag location
use piddir for specifying configure --with-statepath/pidpath/altpidpath
add nut-2.8.0-piddir-owner.patch for upstream tmpfiles config creation to not append /nut and always use owner root
update nut-2.6.3-tmpfiles.patch to use correct tmpfiles config file name
remove unused downstream tmpfiles source and code
2022-12-03 12:24:08 -05:00
Florian Weimer
6db1d50203 Port configure script to C99
Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
2022-11-27 22:18:05 +01:00
Michal Hlavinka
670632e3fd update pid path 2022-08-31 12:36:18 +02:00
Fedora Release Engineering
c1478deaf5 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-22 00:57:20 +00:00
Python Maint
8f6b572231 Rebuilt for Python 3.11 2022-06-13 14:51:42 +02:00
Michal Hlavinka
a136d9db58 drop unused solaris init script pulling unnecessary dependency 2022-06-07 16:14:41 +02:00
Michal Hlavinka
f68641b430 add missing BR 2022-06-07 11:50:21 +02:00
Michal Hlavinka
1e27db6337 change libusb reguirement to libusb1 2022-06-07 10:09:17 +02:00
Michal Hlavinka
4868536690 updated to 2.8.0 2022-06-06 22:39:25 +02:00
Fedora Release Engineering
5c64b71173 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 21:31:57 +00:00
Miro Hrončok
d08ed319dd Don't own /usr/lib/python3.X/site-packages 2021-09-23 13:31:07 +02:00
Sahana Prasad
cdbcbed29f Rebuilt with OpenSSL 3.0.0 2021-09-14 19:09:20 +02:00
Fedora Release Engineering
99495edf47 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 16:26:14 +00:00
Michal Hlavinka
c8d877dae3 drop snmp-ups support for DES, as required net-snmp no longer supports it 2021-06-08 14:08:15 +02:00
Python Maint
4db73a7664 Rebuilt for Python 3.10 2021-06-04 20:13:20 +02:00
Zbigniew Jędrzejewski-Szmek
4fe949d473 Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
2021-03-02 16:13:17 +01:00
Fedora Release Engineering
b05fc4a3e4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 21:47:42 +00:00
Tom Stellard
d6f674e2d5 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-07 06:05:39 +00:00
Jeff Law
82e198976e Force C++14 as this code is not C++17 ready 2020-09-15 14:11:00 -06:00
Josef Řídký
e056aaaff8 Resolves: #1865077 - FTBFS in Fedora 33 2020-09-02 10:28:01 +02:00
Fedora Release Engineering
7c2f27590b - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-08-01 06:34:34 +00:00
Fedora Release Engineering
beee923bc5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 11:59:39 +00:00
Jeff Law
d0c4065968 Revert "- Do not link nut_scanner against libcommon."
This reverts commit 24127d18ec.
2020-07-22 00:21:05 -06:00
Jeff Law
24127d18ec - Do not link nut_scanner against libcommon. 2020-07-21 23:59:27 -06:00
Michal Hlavinka
be87309685 nut user needs tty group for wall (#1774591) 2020-06-02 20:09:33 +02:00
Michal Hlavinka
c06083e691 update tmpfiles nut run directory 2020-06-02 19:57:29 +02:00
Orion Poplawski
457d12308e Drop old udev requires/scriptlet 2020-05-26 20:46:54 -06:00
Orion Poplawski
625fa20c1a Add upstream patch for OpenSSL 1.1.0 support, enable for Fedora >= 33 2020-05-26 20:44:46 -06:00
Miro Hrončok
19a1c7c163 Rebuilt for Python 3.9 2020-05-26 02:54:31 +02:00
Fedora Release Engineering
102a89ce81 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 19:21:07 +00:00
Michal Hlavinka
2ef3bf834e drop pygtk2 requirements 2019-10-04 09:45:54 +02:00
Michal Hlavinka
cedf9ce549 drop python 2 requirements including nut-monitor app 2019-10-03 16:17:01 +02:00
Fedora Release Engineering
6d6c4240b6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 22:41:08 +00:00
Michal Hlavinka
e7cad98650 add missing requirements for nut monitor
fix file descriptor leak for notifycmd
2019-03-25 23:41:39 +01:00
Michal Hlavinka
6eddf6d649 add misssing requires for nut-monitor 2019-03-25 22:47:31 +01:00
Fedora Release Engineering
128086ff93 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 16:38:42 +00:00
Orion Poplawski
42985ff562 Cleanup and modernize spec
Fix ownership/permissions of /var/run/nut (bug #1584330, #1580082)
Fix python shbangs
2018-10-16 11:55:26 -06:00
Peter Robinson
b48267cde3 Updates dependencies, modernise spec, use %%license, Python build fixes 2018-10-16 15:33:01 +01:00
Igor Gnatenko
d7d9d2abad
%{python_sitelib} → %{python2_sitelib}
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-29 23:12:05 +02:00
Adam Williamson
51d7394f5a Rebuild for new net-snmp 2018-07-24 14:53:51 -07:00
Igor Gnatenko
4364ace568 add BuildRequires: gcc-c++
Reference: https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot
2018-07-19 20:56:44 +02:00
Fedora Release Engineering
12a28d2b1f - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 14:34:46 +00:00
Jason Tibbitts
d745e84a4b Remove needless use of %defattr 2018-07-10 02:12:51 -05:00
Xavier Bachelot
691b15bd51 Add changelog entry 2018-04-17 12:35:57 +02:00
Xavier Bachelot
397e5c41fe Add BR: cppunit-devel 2018-04-17 12:35:53 +02:00
Xavier Bachelot
41b09c38c8 Remove unneeded CRLF EOL fix 2018-04-17 12:35:49 +02:00
Xavier Bachelot
b62a6d2d82 Explicitely disable tcpwrapper support 2018-04-17 12:35:44 +02:00
Xavier Bachelot
69892ba5b7 Remove unrecognized configure option --without-hal 2018-04-17 12:35:36 +02:00
Michal Hlavinka
1281c745ae add gcc buildrequire 2018-03-07 16:40:19 +01:00
Iryna Shcherbina
51d283e2d5 Update Python 2 dependency declarations to new packaging standards 2018-02-14 17:17:24 +01:00
Igor Gnatenko
5deb951b81
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 07:23:25 +01:00
Fedora Release Engineering
f4583adfb4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-08 08:34:22 +00:00
Igor Gnatenko
494b207577 Remove old crufty coreutils requires
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2017-11-07 16:33:21 +01:00
Michal Hlavinka
6f70070a28 rebuild for freeipmi update 2017-08-30 12:05:31 +02:00
Fedora Release Engineering
2cfc729677 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 04:10:12 +00:00
Fedora Release Engineering
af0741e201 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-27 01:21:34 +00:00
Michal Hlavinka
00c608028f enable nss crypto (#1463071) 2017-06-22 12:11:35 +02:00
Michal Hlavinka
076835845e update following patch 2017-05-24 13:46:12 +02:00
Michal Hlavinka
ecd6fdf42b fix location of tmpfiles.d in service files (#1399602) 2017-05-24 13:30:31 +02:00
Fedora Release Engineering
89398326b0 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-11 00:24:14 +00:00
Sandro Mani
2de1898467 Rebuild (libwebp) 2017-02-01 19:26:19 +01:00
Michal Hlavinka
274d5184cc use %_tmpfilesdir macro (#1394009) 2016-11-11 17:06:13 +01:00
Till Maas
5b55cc8deb Remove unused patches 2016-09-15 21:47:08 +02:00
Till Maas
f5e8b59a7a Disable powerman support, powerman was retired on Fedora 2016-09-15 21:46:26 +02:00
Michal Hlavinka
43c04986c9 make sure tmpfiles creation is executped before ups driver (#1365904,#1349362) 2016-08-11 18:02:32 +02:00
Fedora Release Engineering
91e73784db - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages 2016-07-19 08:04:37 +00:00
Michal Hlavinka
32c24a124f nut updated to 2.7.4 2016-03-12 00:30:27 +01:00
Fedora Release Engineering
61c166bea2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-04 10:59:55 +00:00
Kalev Lember
75aa58ef26 Rebuilt for libfreeipmi soname bump 2015-12-05 13:53:26 +01:00
Tom Callaway
d3ed363b62 rebuild for libvpx 1.5.0 2015-12-01 16:25:54 -05:00
Dennis Gilmore
3cf2ea1483 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 23:27:24 +00:00
Kalev Lember
b83609e44a Rebuilt for GCC 5 C++11 ABI change 2015-05-03 00:03:28 +02:00
Michal Hlavinka
91dcbb61f1 start nut driver before the daemon 2015-04-28 10:00:45 +02:00
Michal Hlavinka
8d6ef40a5f nut updated to 2.7.3 2015-04-23 17:42:32 +02:00
Tom Callaway
6810be8ca8 disable hardened build 2015-04-07 15:46:15 -04:00
Tom Callaway
64cdce1a9e fPIC 2015-04-07 15:38:01 -04:00
Tom Callaway
aae62efcb7 debug 2015-04-07 15:29:27 -04:00
Tom Callaway
3b235a326d debug 2015-04-07 15:25:30 -04:00
Tom Callaway
bb77561444 revert 2015-04-07 15:16:23 -04:00
Tom Callaway
9b89e67466 fix BR 2015-04-07 15:06:47 -04:00
Tom Callaway
223a546742 fix changelog date 2015-04-07 14:58:22 -04:00
Tom Callaway
9314b026f0 rebuild for libvpx 1.4.0 2015-04-06 16:24:33 -04:00
Michal Hlavinka
4dc3498017 spec cleanup 2014-10-16 15:54:44 +02:00
Michal Hlavinka
4a8e9a8d14 spec cleanup 2014-10-15 13:34:08 +02:00
Peter Robinson
8471d1bdb1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-17 12:31:23 +00:00
Dennis Gilmore
0435df0031 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-07 10:18:03 -05:00
Michal Hlavinka
153ff17ed8 nut updated to 2.7.2 2014-04-22 15:50:06 +02:00
Michal Hlavinka
f6becc5e50 fix multilib issue (#831429) 2014-04-17 08:53:45 +02:00
Michal Hlavinka
ef206e9d2f fix path of nut-driver executable (#1072076)
- fix location of udev rules
2014-03-06 15:51:32 +01:00
Michal Hlavinka
d6655ef281 fix undefined references in libupsclient (#1071919) 2014-03-06 15:01:57 +01:00
Michal Hlavinka
0b850eb3a8 nut updated to 2.7.1 2014-02-27 15:26:42 +01:00
Michal Hlavinka
2ff1cacec5 rebuilt with updated freeipmi (1.3.2) 2013-09-24 12:27:56 +02:00
Michal Hlavinka
40260657ac rebuilt with updated freeipmi 2013-09-03 18:17:00 +02:00
Dennis Gilmore
ac90527835 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild 2013-08-03 09:36:59 -05:00
Remi Collet
1af2bd06c3 rebuild for new GD 2.1.0 2013-06-11 11:35:09 +02:00
Michal Hlavinka
c54a93dcc0 do not let upsmon run during update (#916472)
- make binaries hardened (#955157)
2013-04-22 17:20:14 +02:00
20 changed files with 747 additions and 1361 deletions

10
.gitignore vendored
View file

@ -5,3 +5,13 @@ nut-2.4.3.tar.gz
/nut-2.6.3.tar.gz
/nut-2.6.4.tar.gz
/nut-2.6.5.tar.gz
/nut-2.7.1.tar.gz
/nut-2.7.2.tar.gz
/nut-2.7.3.tar.gz
/nut-2.7.4.tar.gz
/nut-2.8.0.tar.gz
/nut-2.8.1.tar.gz
/nut-2.8.2.tar.gz
/nut-2.8.2.1.tar.gz
/nut-2.8.3.tar.gz
/nut-2.8.4.tar.gz

View file

@ -28,5 +28,5 @@ do
echo "#define $( echo "$l" | tr '[a-z]-' '[A-Z]_')_PATH \"$rp\""
done
VINFO=$(sed -e '/version-info/!d' -e 's/#.*$//' -e 's/^.*-version-info//' -e 's/[[:space:]]//g' clients/Makefile)
VINFO=$(sed -e '/version-info/!d' -e 's/#.*$//' -e 's/^.*-version-info//' -e 's/[[:space:]]//g' -e 's/\\//g' clients/Makefile)
echo "#define LIBUPSCLIENT_PATH \"libupsclient.so.$(( ${VINFO%%:*}-${VINFO##*:} ))\""

View file

@ -1,13 +0,0 @@
Index: nut/conf/upssched.conf.sample.in
===================================================================
--- nut/conf/upssched.conf.sample.in (revision 2057)
+++ nut/conf/upssched.conf.sample.in (revision 2070)
@@ -14,7 +14,7 @@
# A shell script with a big case..esac construct should work nicely for this.
# An example has been provided to help you get started.
-CMDSCRIPT @BINDIR@/upssched-cmd
+CMDSCRIPT @bindir@/upssched-cmd
# ============================================================================
#

View file

@ -1,28 +0,0 @@
Index: /trunk/drivers/libhid.c
===================================================================
--- trunk/drivers/libhid.c (revision 2719)
+++ trunk/drivers/libhid.c (revision 2893)
@@ -142,5 +142,4 @@
int id = pData->ReportID;
int r;
- unsigned char buf[SMALLBUF];
if (rbuf->ts[id] + age > time(NULL)) {
@@ -150,15 +149,12 @@
}
- r = comm_driver->get_report(udev, id, buf, sizeof(buf));
+ r = comm_driver->get_report(udev, id, rbuf->data[id], rbuf->len[id]);
if (r <= 0) {
return -1;
}
- /* broken report descriptors are common, so store whatever we can */
- memcpy(rbuf->data[id], buf, (r < rbuf->len[id]) ? r : rbuf->len[id]);
-
if (rbuf->len[id] != r) {
upsdebugx(2, "%s: expected %d bytes, but got %d instead", __func__, rbuf->len[id], r);
- upsdebug_hex(3, "Report[err]", buf, r);
+ upsdebug_hex(3, "Report[err]", rbuf->data[id], r);
} else {
upsdebug_hex(3, "Report[get]", rbuf->data[id], rbuf->len[id]);

View file

@ -1,11 +1,33 @@
diff -up nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.6.4/scripts/systemd/nut-monitor.service.in
--- nut-2.6.4/scripts/systemd/nut-monitor.service.in.tmpfiles 2012-05-02 23:35:36.000000000 +0200
+++ nut-2.6.4/scripts/systemd/nut-monitor.service.in 2012-06-14 11:38:42.408504102 +0200
@@ -3,6 +3,7 @@ Description=Network UPS Tools - power de
After=local-fs.target network.target nut-server.service
diff -up nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in
--- nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in.tmpfiles 2022-05-09 16:42:37.296229637 +0200
+++ nut-2.8.0/scripts/systemd/nut-driver-enumerator.service.in 2022-05-09 16:42:51.139030657 +0200
@@ -23,6 +23,7 @@ Type=oneshot
# don't want it to fail the unit (when it can't restart).
Environment=REPORT_RESTART_42=no
EnvironmentFile=-@CONFPATH@/nut.conf
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf
ExecStart=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh
ExecReload=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh
diff -up nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-driver@.service.in
--- nut-2.8.0/scripts/systemd/nut-driver@.service.in.tmpfiles 2022-05-09 16:41:00.952614514 +0200
+++ nut-2.8.0/scripts/systemd/nut-driver@.service.in 2022-05-09 16:41:42.783013227 +0200
@@ -40,6 +40,7 @@ PartOf=nut-driver.target
[Service]
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf
ExecStart=@SBINDIR@/upsmon
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf
ExecStart=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl start "$NUTDEV"'
ExecStop=/bin/sh -c 'NUTDEV="`@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --get-device-for-service %i`" && [ -n "$NUTDEV" ] || { echo "FATAL: Could not find a NUT device section for service unit %i" >&2 ; exit 1 ; } ; @SBINDIR@/upsdrvctl stop "$NUTDEV"'
# Restart really always, do not stop trying:
diff -up nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles nut-2.8.0/scripts/systemd/nut-monitor.service.in
--- nut-2.8.0/scripts/systemd/nut-monitor.service.in.tmpfiles 2022-05-09 12:57:35.160646121 +0200
+++ nut-2.8.0/scripts/systemd/nut-monitor.service.in 2022-05-09 16:40:18.289227772 +0200
@@ -18,6 +18,7 @@ PartOf=nut.target
[Service]
EnvironmentFile=-@CONFPATH@/nut.conf
SyslogIdentifier=%N
+ExecStartPre=-/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nut-common.conf
ExecStart=@SBINDIR@/upsmon -F
ExecReload=@SBINDIR@/upsmon -c reload
PIDFile=@PIDPATH@/upsmon.pid
Type=forking

View file

@ -1,126 +0,0 @@
diff -up nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix nut-2.6.5/tools/nut-scanner/scan_avahi.c
--- nut-2.6.5/tools/nut-scanner/scan_avahi.c.dlfix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_avahi.c 2012-09-06 12:56:45.383206759 +0200
@@ -36,7 +36,7 @@
#include <ltdl.h>
/* dynamic link library stuff */
-static char * libname = "libavahi-client";
+static char * libname = LIBAVAHI_CLIENT_PATH;
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
@@ -99,7 +99,7 @@ int nutscan_load_avahi_library()
return 0;
}
- dl_handle = lt_dlopenext(libname);
+ dl_handle = lt_dlopen(libname);
if (!dl_handle) {
dl_error = lt_dlerror();
goto err;
diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix nut-2.6.5/tools/nut-scanner/scan_ipmi.c
--- nut-2.6.5/tools/nut-scanner/scan_ipmi.c.dlfix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_ipmi.c 2012-09-06 12:56:55.760402197 +0200
@@ -30,7 +30,7 @@
#define NUT_IPMI_DRV_NAME "nut-ipmipsu"
/* dynamic link library stuff */
-static char * libname = "libfreeipmi";
+static char * libname = LIBFREEIPMI_PATH;
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
@@ -83,7 +83,7 @@ int nutscan_load_ipmi_library()
return 0;
}
- dl_handle = lt_dlopenext(libname);
+ dl_handle = lt_dlopen(libname);
if (!dl_handle) {
dl_error = lt_dlerror();
goto err;
diff -up nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix nut-2.6.5/tools/nut-scanner/scan_nut.c
--- nut-2.6.5/tools/nut-scanner/scan_nut.c.dlfix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_nut.c 2012-09-06 12:54:59.308897430 +0200
@@ -26,7 +26,7 @@
#include <ltdl.h>
/* dynamic link library stuff */
-static char * libname = "libupsclient";
+static char * libname = LIBUPSCLIENT_PATH;
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
@@ -66,7 +66,7 @@ int nutscan_load_upsclient_library()
return 0;
}
- dl_handle = lt_dlopenext(libname);
+ dl_handle = lt_dlopen(libname);
if (!dl_handle) {
dl_error = lt_dlerror();
goto err;
diff -up nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix nut-2.6.5/tools/nut-scanner/scan_snmp.c
--- nut-2.6.5/tools/nut-scanner/scan_snmp.c.dlfix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_snmp.c 2012-09-06 12:57:16.250774817 +0200
@@ -74,7 +74,7 @@ static int thread_count = 0;
long g_usec_timeout ;
/* dynamic link library stuff */
-static char * libname = "libnetsnmp";
+static char * libname = LIBNETSNMP_PATH;
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
@@ -119,7 +119,7 @@ int nutscan_load_snmp_library()
return 0;
}
- dl_handle = lt_dlopenext(libname);
+ dl_handle = lt_dlopen(libname);
if (!dl_handle) {
dl_error = lt_dlerror();
goto err;
diff -up nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix nut-2.6.5/tools/nut-scanner/scan_usb.c
--- nut-2.6.5/tools/nut-scanner/scan_usb.c.dlfix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_usb.c 2012-09-06 12:56:34.007987045 +0200
@@ -28,7 +28,7 @@
#include <ltdl.h>
/* dynamic link library stuff */
-static char * libname = "libusb";
+static char * libname = LIBUSB_PATH;
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
static int (*nut_usb_close)(usb_dev_handle *dev);
@@ -58,7 +58,7 @@ int nutscan_load_usb_library()
return 0;
}
- dl_handle = lt_dlopenext(libname);
+ dl_handle = lt_dlopen(libname);
if (!dl_handle) {
dl_error = lt_dlerror();
goto err;
diff -up nut-2.6.5/tools/nut-scanner/scan_xml_http.c.dlfix nut-2.6.5/tools/nut-scanner/scan_xml_http.c
--- nut-2.6.5/tools/nut-scanner/scan_xml_http.c.dlfix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_xml_http.c 2012-09-06 12:57:28.617991656 +0200
@@ -33,7 +33,7 @@
#include <ltdl.h>
/* dynamic link library stuff */
-static char * libname = "libneon";
+static char * libname = LIBNEON_PATH;
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
@@ -64,7 +64,7 @@ int nutscan_load_neon_library()
return 0;
}
- dl_handle = lt_dlopenext(libname);
+ dl_handle = lt_dlopen(libname);
if (!dl_handle) {
dl_error = lt_dlerror();
goto err;

View file

@ -1,129 +0,0 @@
diff -up nut-2.6.5/clients/upsmon.c.foreground nut-2.6.5/clients/upsmon.c
--- nut-2.6.5/clients/upsmon.c.foreground 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/clients/upsmon.c 2012-09-11 17:54:55.109343036 +0200
@@ -1659,6 +1659,7 @@ static void help(const char *progname)
printf(" - reload: reread configuration\n");
printf(" - stop: stop monitoring and exit\n");
printf(" -D raise debugging level\n");
+ printf(" -F run in foreground, do not daemonize\n");
printf(" -h display this help\n");
printf(" -K checks POWERDOWNFLAG, sets exit code to 0 if set\n");
printf(" -p always run privileged (disable privileged parent)\n");
@@ -1873,7 +1874,7 @@ static void check_parent(void)
int main(int argc, char *argv[])
{
const char *prog = xbasename(argv[0]);
- int i, cmd = 0, checking_flag = 0;
+ int i, cmd = 0, checking_flag = 0, foreground = 0;
printf("Network UPS Tools %s %s\n", prog, UPS_VERSION);
@@ -1884,7 +1885,7 @@ int main(int argc, char *argv[])
run_as_user = xstrdup(RUN_AS_USER);
- while ((i = getopt(argc, argv, "+Dhic:f:pu:VK46")) != -1) {
+ while ((i = getopt(argc, argv, "+DFhic:f:pu:VK46")) != -1) {
switch (i) {
case 'c':
if (!strncmp(optarg, "fsd", strlen(optarg)))
@@ -1901,6 +1902,9 @@ int main(int argc, char *argv[])
case 'D':
nut_debug_level++;
break;
+ case 'F':
+ foreground = 1;
+ break;
case 'f':
free(configfile);
configfile = xstrdup(optarg);
@@ -1976,9 +1980,9 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
- if (nut_debug_level < 1) {
+ if (!foreground && nut_debug_level < 1) {
background();
- } else {
+ } else if (nut_debug_level >= 1) {
upsdebugx(1, "debug level is '%d'", nut_debug_level);
}
diff -up nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground nut-2.6.5/scripts/systemd/nut-monitor.service.in
--- nut-2.6.5/scripts/systemd/nut-monitor.service.in.foreground 2012-09-11 17:56:05.037920175 +0200
+++ nut-2.6.5/scripts/systemd/nut-monitor.service.in 2012-09-11 17:56:05.038920183 +0200
@@ -4,9 +4,8 @@ After=local-fs.target network.target nut
[Service]
ExecStartPre=-/usr/bin/systemd-tmpfiles --create /etc/tmpfiles.d/nut-client.conf
-ExecStart=@SBINDIR@/upsmon
-PIDFile=@PIDPATH@/upsmon.pid
-Type=forking
+ExecStart=@SBINDIR@/upsmon -F
+Type=simple
[Install]
WantedBy=multi-user.target
diff -up nut-2.6.5/scripts/systemd/nut-server.service.in.foreground nut-2.6.5/scripts/systemd/nut-server.service.in
--- nut-2.6.5/scripts/systemd/nut-server.service.in.foreground 2012-09-11 17:56:19.850042294 +0200
+++ nut-2.6.5/scripts/systemd/nut-server.service.in 2012-09-11 17:56:19.851042303 +0200
@@ -5,8 +5,8 @@ Requires=nut-driver.service
Before=nut-monitor.service
[Service]
-ExecStart=@SBINDIR@/upsd
-Type=forking
+ExecStart=@SBINDIR@/upsd -F
+Type=simple
[Install]
WantedBy=multi-user.target
diff -up nut-2.6.5/server/upsd.c.foreground nut-2.6.5/server/upsd.c
--- nut-2.6.5/server/upsd.c.foreground 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/server/upsd.c 2012-09-11 17:54:55.109343036 +0200
@@ -819,6 +819,7 @@ static void help(const char *progname)
printf(" - reload: reread configuration files\n");
printf(" - stop: stop process and exit\n");
printf(" -D raise debugging level\n");
+ printf(" -F run in foreground, do not daemonize\n");
printf(" -h display this help\n");
printf(" -r <dir> chroots to <dir>\n");
printf(" -q raise log level threshold\n");
@@ -882,7 +883,7 @@ void check_perms(const char *fn)
int main(int argc, char **argv)
{
- int i, cmd = 0;
+ int i, cmd = 0, foreground = 0;
char *chroot_path = NULL;
const char *user = RUN_AS_USER;
struct passwd *new_uid = NULL;
@@ -898,7 +899,7 @@ int main(int argc, char **argv)
printf("Network UPS Tools %s %s\n", progname, UPS_VERSION);
- while ((i = getopt(argc, argv, "+h46p:qr:i:fu:Vc:D")) != -1) {
+ while ((i = getopt(argc, argv, "+hF46p:qr:i:fu:Vc:D")) != -1) {
switch (i) {
case 'h':
help(progname);
@@ -936,6 +937,10 @@ int main(int argc, char **argv)
nut_debug_level++;
break;
+ case 'F':
+ foreground = 1;
+ break;
+
case '4':
opt_af = AF_INET;
break;
@@ -1023,7 +1028,7 @@ int main(int argc, char **argv)
/* handle upsd.users */
user_load();
- if (!nut_debug_level) {
+ if (!nut_debug_level && !foreground) {
background();
writepid(pidfn);
} else {

View file

@ -1,138 +0,0 @@
diff -up nut-2.6.5/drivers/nut-libfreeipmi.c.ipmifix nut-2.6.5/drivers/nut-libfreeipmi.c
--- nut-2.6.5/drivers/nut-libfreeipmi.c.ipmifix 2012-07-31 19:38:59.000000000 +0200
+++ nut-2.6.5/drivers/nut-libfreeipmi.c 2012-09-04 09:42:48.000000000 +0200
@@ -49,6 +49,36 @@
#include "nut-ipmi.h"
#include "dstate.h"
+#ifdef HAVE_FREEIPMI_11X_12X
+#define ipmi_fru_parse_ctx_t ipmi_fru_ctx_t
+#define nut_ipmi_fru_parse_close_device_id nut_ipmi_fru_close_device_id
+#define nut_ipmi_fru_parse_ctx_destroy nut_ipmi_fru_ctx_destroy
+#define nut_ipmi_fru_parse_ctx_create nut_ipmi_fru_ctx_create
+#define nut_ipmi_fru_parse_ctx_set_flags nut_ipmi_fru_ctx_set_flags
+#define nut_ipmi_fru_parse_open_device_id nut_ipmi_fru_open_device_id
+#define nut_ipmi_fru_parse_ctx_errormsg nut_ipmi_fru_ctx_errormsg
+#define nut_ipmi_fru_parse_next nut_ipmi_fru_next
+#define IPMI_FRU_PARSE_AREA_SIZE_MAX IPMI_FRU_AREA_SIZE_MAX
+#define IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS IPMI_FRU_FLAGS_SKIP_CHECKSUM_CHECKS
+#define IPMI_FRU_PARSE_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION IPMI_FRU_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION
+#define IPMI_FRU_PARSE_AREA_TYPE_BOARD_INFO_AREA IPMI_FRU_AREA_TYPE_BOARD_INFO_AREA
+#define ipmi_fru_parse_field_t ipmi_fru_field_t
+#define ipmi_fru_parse_ctx_create ipmi_fru_ctx_create
+#define ipmi_fru_parse_ctx_set_flags ipmi_fru_ctx_set_flags
+#define ipmi_fru_parse_ctx_strerror ipmi_fru_ctx_strerror
+#define ipmi_fru_parse_ctx_errnum ipmi_fru_ctx_errnum
+#define ipmi_fru_parse_open_device_id ipmi_fru_open_device_id
+#define ipmi_fru_parse_ctx_errormsg ipmi_fru_ctx_errormsg
+#define ipmi_fru_parse_read_data_area ipmi_fru_read_data_area
+#define ipmi_fru_parse_type_length_field_to_string ipmi_fru_type_length_field_to_string
+#define ipmi_fru_parse_close_device_id ipmi_fru_close_device_id
+#define ipmi_fru_parse_ctx_destroy ipmi_fru_ctx_destroy
+#define ipmi_fru_parse_multirecord_power_supply_information ipmi_fru_multirecord_power_supply_information
+#define ipmi_fru_parse_board_info_area ipmi_fru_board_info_area
+#define ipmi_fru_parse_next ipmi_fru_next
+#define IPMI_FRU_PARSE_AREA_STRING_MAX IPMI_FRU_AREA_STRING_MAX
+#endif
+
/* FreeIPMI defines */
#define IPMI_FRU_STR_BUFLEN 1024
/* haven't seen a motherboard with more than 2-3 so far,
diff -up nut-2.6.5/m4/nut_check_libfreeipmi.m4.ipmifix nut-2.6.5/m4/nut_check_libfreeipmi.m4
--- nut-2.6.5/m4/nut_check_libfreeipmi.m4.ipmifix 2012-07-31 19:38:56.000000000 +0200
+++ nut-2.6.5/m4/nut_check_libfreeipmi.m4 2012-09-04 09:45:45.399328962 +0200
@@ -66,15 +66,23 @@ if test -z "${nut_have_libfreeipmi_seen}
dnl when version cannot be tested (prior to 1.0.5, with no pkg-config)
dnl we have to check for some specific functions
AC_SEARCH_LIBS([ipmi_ctx_find_inband], [freeipmi], [], [nut_have_freeipmi=no])
- AC_SEARCH_LIBS([ipmi_fru_parse_ctx_create], [freeipmi], [], [nut_have_freeipmi=no])
AC_SEARCH_LIBS([ipmi_monitoring_init], [ipmimonitoring], [nut_have_freeipmi_monitoring=yes], [nut_have_freeipmi_monitoring=no])
AC_SEARCH_LIBS([ipmi_monitoring_sensor_read_record_id], [ipmimonitoring], [], [nut_have_freeipmi_monitoring=no])
dnl Check for FreeIPMI 1.1.X / 1.2.X which implies API changes!
- AC_SEARCH_LIBS([ipmi_sdr_cache_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=no], [])
+ nut_have_freeipmi_old="${nut_have_freeipmi}"
+ AC_SEARCH_LIBS([ipmi_fru_parse_ctx_create], [freeipmi], [nut_have_freeipmi_11x_12x=no], [nut_have_freeipmi_old=no])
+ AC_SEARCH_LIBS([ipmi_sdr_cache_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=no], [nut_have_freeipmi_old=no])
+ AC_SEARCH_LIBS([ipmi_fru_ctx_create], [freeipmi], [nut_have_freeipmi_11x_12x=yes], [nut_have_freeipmi_11x_12x=no])
AC_SEARCH_LIBS([ipmi_sdr_ctx_destroy], [freeipmi], [nut_have_freeipmi_11x_12x=yes], [nut_have_freeipmi_11x_12x=no])
+ if test "${nut_have_freeipmi}${nut_have_freeipmi_11x_12x}" = "yesyes"; then
+ AC_DEFINE(HAVE_FREEIPMI_11X_12X, 1, [Define if FreeIPMI 1.1.X / 1.2.X support is available])
+ elif test "${nut_have_freeipmi_old}" = "no"; then
+ nut_have_freeipmi="no"
+ fi
+
if test "${nut_have_freeipmi}" = "yes"; then
nut_with_ipmi="yes"
nut_ipmi_lib="(FreeIPMI)"
@@ -84,10 +92,6 @@ if test -z "${nut_have_libfreeipmi_seen}
LIBIPMI_LIBS="${LIBS}"
fi
- if test "${nut_have_freeipmi_11x_12x}" = "yes"; then
- AC_DEFINE(HAVE_FREEIPMI_11X_12X, 1, [Define if FreeIPMI 1.1.X / 1.2.X support is available])
- fi
-
if test "${nut_have_freeipmi_monitoring}" = "yes"; then
AC_DEFINE(HAVE_FREEIPMI_MONITORING, 1, [Define if FreeIPMI monitoring support is available])
fi
diff -up nut-2.6.5/tools/nut-scanner/scan_ipmi.c.ipmifix nut-2.6.5/tools/nut-scanner/scan_ipmi.c
--- nut-2.6.5/tools/nut-scanner/scan_ipmi.c.ipmifix 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/tools/nut-scanner/scan_ipmi.c 2012-09-04 09:42:35.000000000 +0200
@@ -34,24 +34,50 @@ static char * libname = "libfreeipmi";
static lt_dlhandle dl_handle = NULL;
static const char *dl_error = NULL;
-static int (*nut_ipmi_fru_parse_close_device_id) (ipmi_fru_parse_ctx_t ctx);
-static void (*nut_ipmi_fru_parse_ctx_destroy) (ipmi_fru_parse_ctx_t ctx);
#ifdef HAVE_FREEIPMI_11X_12X
static void (*nut_ipmi_sdr_ctx_destroy) (ipmi_sdr_ctx_t ctx);
+static int (*nut_ipmi_fru_close_device_id) (ipmi_fru_ctx_t ctx);
+static void (*nut_ipmi_fru_ctx_destroy) (ipmi_fru_ctx_t ctx);
+static ipmi_fru_ctx_t (*nut_ipmi_fru_ctx_create) (ipmi_ctx_t ipmi_ctx);
+static int (*nut_ipmi_fru_ctx_set_flags) (ipmi_fru_ctx_t ctx, unsigned int flags);
+static int (*nut_ipmi_fru_open_device_id) (ipmi_fru_ctx_t ctx, uint8_t fru_device_id);
+static char * (*nut_ipmi_fru_ctx_errormsg) (ipmi_fru_ctx_t ctx);
+static int (*nut_ipmi_fru_next) (ipmi_fru_ctx_t ctx);
#else /* HAVE_FREEIPMI_11X_12X */
+static int (*nut_ipmi_fru_parse_close_device_id) (ipmi_fru_parse_ctx_t ctx);
+static void (*nut_ipmi_fru_parse_ctx_destroy) (ipmi_fru_parse_ctx_t ctx);
static void (*nut_ipmi_sdr_cache_ctx_destroy) (ipmi_sdr_cache_ctx_t ctx);
static void (*nut_ipmi_sdr_parse_ctx_destroy) (ipmi_sdr_parse_ctx_t ctx);
-#endif /* HAVE_FREEIPMI_11X_12X */
static ipmi_fru_parse_ctx_t (*nut_ipmi_fru_parse_ctx_create) (ipmi_ctx_t ipmi_ctx);
static int (*nut_ipmi_fru_parse_ctx_set_flags) (ipmi_fru_parse_ctx_t ctx, unsigned int flags);
static int (*nut_ipmi_fru_parse_open_device_id) (ipmi_fru_parse_ctx_t ctx, uint8_t fru_device_id);
static char * (*nut_ipmi_fru_parse_ctx_errormsg) (ipmi_fru_parse_ctx_t ctx);
+static int (*nut_ipmi_fru_parse_next) (ipmi_fru_parse_ctx_t ctx);
+#endif /* HAVE_FREEIPMI_11X_12X */
+
+#ifndef ipmi_fru_parse_ctx_t
+#define ipmi_fru_parse_ctx_t ipmi_fru_ctx_t
+#endif
+
+#ifndef nut_ipmi_fru_parse_close_device_id
+#define nut_ipmi_fru_parse_close_device_id nut_ipmi_fru_close_device_id
+#endif
+
+#define nut_ipmi_fru_parse_ctx_destroy nut_ipmi_fru_ctx_destroy
+#define nut_ipmi_fru_parse_ctx_create nut_ipmi_fru_ctx_create
+#define nut_ipmi_fru_parse_ctx_set_flags nut_ipmi_fru_ctx_set_flags
+#define nut_ipmi_fru_parse_open_device_id nut_ipmi_fru_open_device_id
+#define nut_ipmi_fru_parse_ctx_errormsg nut_ipmi_fru_ctx_errormsg
+#define nut_ipmi_fru_parse_next nut_ipmi_fru_next
+#define IPMI_FRU_PARSE_AREA_SIZE_MAX IPMI_FRU_AREA_SIZE_MAX
+#define IPMI_FRU_PARSE_FLAGS_SKIP_CHECKSUM_CHECKS IPMI_FRU_FLAGS_SKIP_CHECKSUM_CHECKS
+#define IPMI_FRU_PARSE_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION IPMI_FRU_AREA_TYPE_MULTIRECORD_POWER_SUPPLY_INFORMATION
+
static int (*nut_ipmi_fru_parse_read_data_area) (ipmi_fru_parse_ctx_t ctx,
unsigned int *area_type,
unsigned int *area_length,
void *areabuf,
unsigned int areabuflen);
-static int (*nut_ipmi_fru_parse_next) (ipmi_fru_parse_ctx_t ctx);
static ipmi_ctx_t (*nut_ipmi_ctx_create) (void);
static int (*nut_ipmi_ctx_find_inband) (ipmi_ctx_t ctx,
ipmi_driver_type_t *driver_type,

View file

@ -1,32 +0,0 @@
diff -up nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix nut-2.6.5/tools/nut-scanner/nut-scanner.c
--- nut-2.6.5/tools/nut-scanner/nut-scanner.c.pthreadfix 2012-09-06 13:25:03.856936357 +0200
+++ nut-2.6.5/tools/nut-scanner/nut-scanner.c 2012-09-06 13:25:03.881936493 +0200
@@ -434,22 +434,22 @@ display_help:
}
#ifdef HAVE_PTHREAD
- if( allow_usb && nutscan_avail_usb ) {
+ if( allow_usb && nutscan_avail_usb && thread[TYPE_USB]) {
pthread_join(thread[TYPE_USB],NULL);
}
- if( allow_snmp && nutscan_avail_snmp ) {
+ if( allow_snmp && nutscan_avail_snmp && thread[TYPE_SNMP]) {
pthread_join(thread[TYPE_SNMP],NULL);
}
- if( allow_xml && nutscan_avail_xml_http ) {
+ if( allow_xml && nutscan_avail_xml_http && thread[TYPE_XML]) {
pthread_join(thread[TYPE_XML],NULL);
}
- if( allow_oldnut && nutscan_avail_nut ) {
+ if( allow_oldnut && nutscan_avail_nut && thread[TYPE_NUT]) {
pthread_join(thread[TYPE_NUT],NULL);
}
- if( allow_avahi && nutscan_avail_avahi ) {
+ if( allow_avahi && nutscan_avail_avahi && thread[TYPE_AVAHI]) {
pthread_join(thread[TYPE_AVAHI],NULL);
}
- if( allow_ipmi && nutscan_avail_ipmi ) {
+ if( allow_ipmi && nutscan_avail_ipmi && thread[TYPE_IPMI]) {
pthread_join(thread[TYPE_IPMI],NULL);
}
#endif /* HAVE_PTHREAD */

View file

@ -1,14 +0,0 @@
diff -up nut-2.6.5/configure.in.quickfix nut-2.6.5/configure.in
--- nut-2.6.5/configure.in.quickfix 2012-08-10 14:19:55.924431026 +0200
+++ nut-2.6.5/configure.in 2012-08-10 14:20:13.332566508 +0200
@@ -986,9 +986,8 @@ dnl Override installation directory, wit
dnl prefix. This is needed for 'distcheck*' targets, otherwise
dnl files will try to get intalled to the actual system directories
if test -n "${systemdsystemunitdir}"; then
- systemdsystemshutdowndir="${libdir}/systemd/system-shutdown"
+ systemdsystemshutdowndir="/lib/systemd/system-shutdown"
AC_MSG_RESULT(using ${systemdsystemunitdir})
- systemdsystemunitdir="`echo ${systemdsystemunitdir} | sed 's/\/lib/\${libdir}/'`"
else
AC_MSG_RESULT(no)
fi

View file

@ -1,59 +1,58 @@
diff -up nut-2.6.5/clients/upsmon.c.rmpidf nut-2.6.5/clients/upsmon.c
--- nut-2.6.5/clients/upsmon.c.rmpidf 2013-02-28 12:08:34.487394359 +0100
+++ nut-2.6.5/clients/upsmon.c 2013-02-28 12:08:34.494394419 +0100
@@ -2037,6 +2037,7 @@ int main(int argc, char *argv[])
diff -up nut-2.8.2.1/clients/upsmon.c.rmpidf nut-2.8.2.1/clients/upsmon.c
--- nut-2.8.2.1/clients/upsmon.c.rmpidf 2024-07-03 12:18:04.788135176 +0200
+++ nut-2.8.2.1/clients/upsmon.c 2024-07-03 12:19:33.164964473 +0200
@@ -3309,6 +3309,7 @@ int main(int argc, char *argv[])
upslogx(LOG_INFO, "Signal %d: exiting", exit_flag);
upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag);
upsmon_cleanup();
+ cleanpid(prog);
upsdebugx(1, "Finally exiting due to signal %d", exit_flag);
exit(EXIT_SUCCESS);
}
diff -up nut-2.6.5/common/common.c.rmpidf nut-2.6.5/common/common.c
--- nut-2.6.5/common/common.c.rmpidf 2012-07-31 19:38:58.000000000 +0200
+++ nut-2.6.5/common/common.c 2013-02-28 12:08:34.494394419 +0100
@@ -229,6 +229,20 @@ void writepid(const char *name)
umask(mask);
diff -up nut-2.8.2.1/common/common.c.rmpidf nut-2.8.2.1/common/common.c
--- nut-2.8.2.1/common/common.c.rmpidf 2024-07-03 12:14:56.000000000 +0200
+++ nut-2.8.2.1/common/common.c 2024-07-03 12:18:04.788135176 +0200
@@ -1338,6 +1338,20 @@ pid_t parsepid(const char *buf)
return pid;
}
+/* remove pid file */
+void cleanpid(const char *name)
+{
+ char fn[SMALLBUF];
+ char fn[SMALLBUF];
+
+ /* use full path if present, else build filename in PIDPATH */
+ if (*name == '/')
+ snprintf(fn, sizeof(fn), "%s", name);
+ else
+ snprintf(fn, sizeof(fn), "%s/%s.pid", PIDPATH, name);
+ /* use full path if present, else build filename in PIDPATH */
+ if (*name == '/')
+ snprintf(fn, sizeof(fn), "%s", name);
+ else
+ snprintf(fn, sizeof(fn), "%s/%s.pid", PIDPATH, name);
+
+ unlink(fn);
+ unlink(fn);
+}
+
/* open pidfn, get the pid, then send it sig */
int sendsignalfn(const char *pidfn, int sig)
{
diff -up nut-2.6.5/include/common.h.rmpidf nut-2.6.5/include/common.h
--- nut-2.6.5/include/common.h.rmpidf 2012-07-31 19:38:56.000000000 +0200
+++ nut-2.6.5/include/common.h 2013-02-28 12:08:34.495394429 +0100
@@ -64,6 +64,9 @@ void chroot_start(const char *path);
/* open pidfn, get the pid, then send it sig
* returns negative codes for errors, or
* zero for a successfully sent signal
diff -up nut-2.8.2.1/include/common.h.rmpidf nut-2.8.2.1/include/common.h
--- nut-2.8.2.1/include/common.h.rmpidf 2024-07-03 12:14:56.000000000 +0200
+++ nut-2.8.2.1/include/common.h 2024-07-03 12:18:04.788135176 +0200
@@ -262,6 +262,9 @@ int checkprocname(pid_t pid, const char
/* write a pid file - <name> is a full pathname *or* just the program name */
void writepid(const char *name);
+/* remove pid file */
+void cleanpid(const char *name);
+
/* send a signal to another running process */
int sendsignal(const char *progname, int sig);
/* parses string buffer into a pid_t if it passes
* a few sanity checks; returns -1 on error */
pid_t parsepid(const char *buf);
diff -up nut-2.8.2.1/server/upsd.c.rmpidf nut-2.8.2.1/server/upsd.c
--- nut-2.8.2.1/server/upsd.c.rmpidf 2024-07-03 12:14:56.000000000 +0200
+++ nut-2.8.2.1/server/upsd.c 2024-07-03 12:18:04.789135186 +0200
@@ -2304,5 +2304,6 @@ int main(int argc, char **argv)
upsnotify(NOTIFY_STATE_STOPPING, "Signal %d: exiting", exit_flag);
diff -up nut-2.6.5/server/upsd.c.rmpidf nut-2.6.5/server/upsd.c
--- nut-2.6.5/server/upsd.c.rmpidf 2013-02-28 12:08:37.967424582 +0100
+++ nut-2.6.5/server/upsd.c 2013-02-28 12:08:37.982424720 +0100
@@ -1040,6 +1040,7 @@ int main(int argc, char **argv)
}
upslogx(LOG_INFO, "Signal %d: exiting", exit_flag);
ssl_cleanup();
+ if (*pidfn) cleanpid(pidfn);
return EXIT_SUCCESS;
}

View file

@ -1,39 +0,0 @@
diff -up nut-2.6.5/scripts/python/app/NUT-Monitor.unreachable nut-2.6.5/scripts/python/app/NUT-Monitor
--- nut-2.6.5/scripts/python/app/NUT-Monitor.unreachable 2012-07-31 19:38:56.000000000 +0200
+++ nut-2.6.5/scripts/python/app/NUT-Monitor 2013-01-07 18:04:26.532531441 +0100
@@ -674,6 +674,11 @@ class interface :
self.gui_status_notification( _("Device '%s' not found on server") % self.__current_ups, "warning.png" )
return
+ if not self.__ups_handler.CheckUPSAvailable( self.__current_ups ):
+ self.gui_status_message( _("UPS '{0}' is not reachable").format( self.__current_ups ) )
+ self.gui_status_notification( _("UPS '{0}' is not reachable").format( self.__current_ups ), "warning.png" )
+ return
+
self.__connected = True
self.__widgets["ups_connect"].hide()
self.__widgets["ups_disconnect"].show()
diff -up nut-2.6.5/scripts/python/module/PyNUT.py.unreachable nut-2.6.5/scripts/python/module/PyNUT.py
--- nut-2.6.5/scripts/python/module/PyNUT.py.unreachable 2012-07-31 19:38:56.000000000 +0200
+++ nut-2.6.5/scripts/python/module/PyNUT.py 2013-01-07 17:41:26.548440712 +0100
@@ -158,6 +158,20 @@ available vars.
return( ups_vars )
+ def CheckUPSAvailable( self, ups="") :
+ """ Check whether UPS is reachable
+
+Just tries to contact UPS with safe command.
+The result is True (rechable) or False (unreachable)
+ """
+ self.__srv_handler.write( "LIST CMD %s\n" % ups )
+ result = self.__srv_handler.read_until( "\n" )
+ if result != "BEGIN LIST CMD %s\n" % ups :
+ return False
+
+ self.__srv_handler.read_until( "END LIST CMD %s\n" % ups )
+ return True
+
def GetUPSCommands( self, ups="" ) :
""" Get all available commands for the specified UPS

View file

@ -0,0 +1,50 @@
diff -up nut-2.8.1/configure.ac.piddir-owner nut-2.8.1/configure.ac
--- nut-2.8.1/configure.ac.piddir-owner 2023-11-01 09:39:24.267596406 +0100
+++ nut-2.8.1/configure.ac 2023-11-01 10:00:35.425987029 +0100
@@ -4451,7 +4451,7 @@ AS_IF([test -n "$systemdtmpfilesdir"],
# See also: https://github.com/networkupstools/nut/wiki/Technicalities:-Work-with-PID-and-state-file-paths#pidpath-altpidpath-statepath
# State file (e.g. upsd to driver pipes) and PID file location for NUT:
-d @STATEPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
+d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - -
# Default PIPEFN and LOCKFN locations per upssched.conf:
d @STATEPATH@/upssched 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
X @STATEPATH@
@@ -4461,7 +4461,7 @@ EOF
[*/run|*/tmp|*/shm], [], dnl Do not intrude into system paths; TODO: add more if appropriate for some Linux distro
[cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common-tmpfiles.conf.in << EOF
# Primarily used by upsmon and upslog, possibly running as root:
-d @PIDPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
+d @PIDPATH@ 0770 root @RUN_AS_GROUP@ - -
X @PIDPATH@
EOF
])])
@@ -4469,14 +4469,14 @@ EOF
[cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common-tmpfiles.conf.in << EOF
# Should be used as upsd and driver PID file location for NUT
# (if ALTPIDPATH differs from STATEPATH):
-d @ALTPIDPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
+d @ALTPIDPATH@ 0770 root @RUN_AS_GROUP@ - -
X @ALTPIDPATH@
EOF])
dnl Generally added to support some forks
AS_IF([test -n "$ALTSTATEPATH" && test "$STATEPATH" != "$ALTSTATEPATH" && test "$ALTSTATEPATH" != "$ALTPIDPATH" && test "$PIDPATH" != "$ALTSTATEPATH"],
[cat >> "${TOP_BUILDDIR}"/scripts/systemd/nut-common-tmpfiles.conf.in << EOF
# Some NUT variants also maintain an ALTSTATEPATH:
-d @ALTSTATEPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
+d @ALTSTATEPATH@ 0770 root @RUN_AS_GROUP@ - -
X @ALTSTATEPATH@
EOF])
])
diff -up nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in.piddir-owner nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in
--- nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in.piddir-owner 2023-10-31 23:05:03.000000000 +0100
+++ nut-2.8.1/scripts/systemd/nut-common-tmpfiles.conf.in 2023-11-01 10:03:46.970845553 +0100
@@ -5,7 +5,7 @@
# See also: https://github.com/networkupstools/nut/wiki/Technicalities:-Work-with-PID-and-state-file-paths#pidpath-altpidpath-statepath
# State file (e.g. upsd to driver pipes) and PID file location for NUT:
-d @STATEPATH@ 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
+d @STATEPATH@ 0770 root @RUN_AS_GROUP@ - -
# Default PIPEFN and LOCKFN locations per upssched.conf:
d @STATEPATH@/upssched 0770 @RUN_AS_USER@ @RUN_AS_GROUP@ - -
X @STATEPATH@

23
nut-2.8.3-rhinoname.patch Normal file
View file

@ -0,0 +1,23 @@
diff -up nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am.rhinoname nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am
--- nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am.rhinoname 2025-08-14 11:08:48.763700333 +0200
+++ nut-2.8.4-build/nut-2.8.4/drivers/Makefile.am 2025-08-14 11:29:43.803846801 +0200
@@ -74,7 +74,7 @@ NUTSW_DRIVERLIST = $(NUTSW_DRIVERLIST_DU
SERIAL_DRIVERLIST = al175 bcmxcp belkin belkinunv bestfcom \
bestfortress bestuferrups bestups etapro everups \
gamatronic genericups isbmex liebert liebert-esp2 liebert-gxe masterguard metasys \
- mge-utalk microdowell microsol-apc mge-shut nutdrv_hashx oneac optiups powercom powervar_cx_ser rhino \
+ mge-utalk microdowell microsol-apc mge-shut nutdrv_hashx oneac optiups powercom powervar_cx_ser nutdrv_rhino \
safenet nutdrv_siemens-sitop solis tripplite tripplitesu upscode2 victronups powerpanel \
blazer_ser ivtscd apcsmart apcsmart-old riello_ser sms_ser bicker_ser ve-direct
if HAVE_LINUX_SERIAL_H
@@ -198,8 +198,8 @@ powerpanel_SOURCES = powerpanel.c powerp
powerpanel_LDADD = $(LDADD) -lm
powervar_cx_ser_SOURCES = powervar_cx_ser.c powervar_cx.c
powervar_cx_ser_CFLAGS = $(AM_CFLAGS) -DPVAR_SERIAL=1
-rhino_SOURCES = rhino.c
-rhino_LDADD = $(LDADD) -lm
+nutdrv_rhino_SOURCES = rhino.c
+nutdrv_rhino_LDADD = $(LDADD) -lm
safenet_SOURCES = safenet.c
nutdrv_siemens_sitop_SOURCES = nutdrv_siemens_sitop.c
solis_SOURCES = solis.c

17
nut-c99-strdup.patch Normal file
View file

@ -0,0 +1,17 @@
Fix strdup configure test: Remove a call to the undeclared free
function.
Submitted upstream: <https://github.com/networkupstools/nut/pull/1720>
diff --git a/configure.ac b/configure.ac
index 3aa26c24ebc99bb6..c93ccd1e494874d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -294,7 +294,6 @@ AC_CACHE_CHECK([for strdup(s)],
char *t = "Test";
char *s = strdup(t);
if (!s || !(s[0]=='T'&&s[1]=='e'&&s[2]=='s'&&s[3]=='t'&&s[4]=='\0') || s == t) res = 1;
-if (s) free (s);
if (res != 0) return res
/* autoconf adds ";return 0;" */
]])],

View file

@ -1 +0,0 @@
D /var/run/nut 0750 nut nut -

1222
nut.spec

File diff suppressed because it is too large Load diff

View file

@ -1 +1 @@
e6eac4fa04baff0d0a827d64efe81a7e nut-2.6.5.tar.gz
SHA512 (nut-2.8.4.tar.gz) = 0d87c0006608f92ae54f8a500f93d9a81eac1d9abf57f32e7718dd72f265b8293a0b6cdba04c802b81eaf8907b52669c36b47b6875a4377f9752845ac6c5e8fa

147
ups.init
View file

@ -1,147 +0,0 @@
#! /bin/bash
#
# ups: Starts the Network UPS Tools
#
# chkconfig: - 26 74
# description: Network UPS Tools is a collection of programs which provide a common \
# interface for monitoring and administering UPS hardware.
# processname: upsd
# config: /etc/ups/
# config: /etc/sysconfig/ups
#
### BEGIN INIT INFO
# Provides: ups
# Required-Start: $syslog $network $named
# Required-Stop: $local_fs
# Default-Stop: 0 1 6
# Short-Description: Starts the Network UPS tools
# Description: Network UPS Tools is a collection of programs which provide a common \
# interface for monitoring and administering UPS hardware.
### END INIT INFO
# Source function library.
if [ -f /etc/init.d/functions ]; then
. /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
. /etc/rc.d/init.d/functions
else
exit 0
fi
# Get config.
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
SERVER="no"
fi
start() {
if [ "$SERVER" = "yes" ]; then
echo -n $"Starting UPS driver controller: "
daemon /sbin/upsdrvctl start > /dev/null 2>&1 && success || failure
RETVAL=$?
echo
prog="upsd"
echo -n $"Starting $prog: "
daemon /usr/sbin/upsd $UPSD_OPTIONS > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
echo -n $"Starting UPS monitor (master): "
daemon --pidfile /var/run/nut/upsmon.pid /usr/sbin/upsmon > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
else
echo -n $"Starting UPS monitor (slave): "
daemon --pidfile /var/run/nut/upsmon.pid /usr/sbin/upsmon > /dev/null 2>&1 && success || failure
echo
fi
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/ups
}
stop() {
echo -n $"Stopping UPS monitor: "
killproc -p /var/run/nut/upsmon.pid upsmon
echo
if [ "$SERVER" = "yes" ]; then
prog="upsd"
echo -n $"Stopping $prog: "
killproc upsd > /dev/null 2>&1 && success || failure
RETVAL=$?
echo
echo -n $"Shutting down UPS driver controller: "
/sbin/upsdrvctl stop > /dev/null 2>&1 && success || failure
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
echo
fi
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/ups
}
restart() {
stop
waitmore=5
while [ -n "$(ls /var/run/nut/)" -a $waitmore -ge 1 ]
do
sleep 1
waitmore=$((waitmore-1))
done
start
}
reload() {
# FIXME: upsd and upsmon always return 0
# => can't tell if reload was successful
if [ "$SERVER" = "yes" ]; then
action "Reloading upsd:" /usr/sbin/upsd -c reload
RETVAL=$?
fi
action "Reloading upsmon:" /usr/sbin/upsmon -c reload
if [ "$RETVAL" = 0 ]; then
RETVAL=$?
fi
}
# See how we are called.
case "$1" in
start)
start ;;
stop)
stop ;;
restart)
restart ;;
try-restart)
[ -f /var/lock/subsys/ups ] && restart || :
;;
reload)
reload ;;
force-reload)
restart ;;
status)
if [ "$SERVER" = "yes" ]; then
status upsd
fi
status upsmon
;;
*)
echo $"Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status}"
RETVAL=3
esac
exit $RETVAL

View file

@ -1,8 +0,0 @@
# If the UPS is locally attached set it to "yes"
SERVER=yes
# Any options to pass to upsd
UPSD_OPTIONS=
# This *must* be the same as in /etc/ups/upsmon.conf
POWERDOWNFLAG=/etc/killpower
#
# [End]