diff --git a/0001-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch b/0001-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch deleted file mode 100644 index 9ac8501..0000000 --- a/0001-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 80468a84ea3044a5227c57a258dc6e508c88d468 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 6 Feb 2019 13:25:47 +0000 -Subject: [PATCH] Choose libtirpc or another RPC library for XDR headers and - library. - -Signed-off-by: Richard W.M. Jones ---- - configure.ac | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 4294146..be62260 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -158,4 +158,24 @@ AC_ARG_WITH(randomseed, - AC_MSG_RESULT("/var/run/random-seed") - ]) - -+# Check for an RPC library, starting with libtirpc. -+PKG_CHECK_MODULES([RPC], [libtirpc], [], [ -+ # If we don't have libtirpc, then we must have and -+ # some library to link to in libdir. -+ RPC_CFLAGS="" -+ AC_CHECK_HEADER([rpc/rpc.h],[],[ -+ AC_MSG_ERROR([XDR header files are required]) -+ ], -+ [#include ]) -+ -+ old_LIBS="$LIBS" -+ LIBS="" -+ AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl]) -+ RPC_LIBS="$LIBS" -+ LIBS="$old_LIBS" -+ -+ AC_SUBST([RPC_CFLAGS]) -+ AC_SUBST([RPC_LIBS]) -+]) -+ - AC_OUTPUT([Makefile src/Makefile]) --- -2.31.1 - diff --git a/0002-mem-leak-verbose.patch b/0002-mem-leak-verbose.patch deleted file mode 100644 index 2341c4b..0000000 --- a/0002-mem-leak-verbose.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -ruNp a/src/run-as-child.c b/src/run-as-child.c ---- a/src/run-as-child.c 2021-10-14 08:17:04.556107815 +0200 -+++ b/src/run-as-child.c 2021-10-14 08:36:23.686706344 +0200 -@@ -98,8 +98,14 @@ int exec_as_func(int flags, void *ptr) - /* Create single string with all command line options. */ - int ii = 1; - char *opt = strdup(":"); -+ char *tempOpt; - while (opt != NULL && arg[ii] != NULL) { -- opt = realloc(opt, strlen(opt) + strlen(arg[ii]) + 2); -+ tempOpt = realloc(opt, strlen(opt) + strlen(arg[ii]) + 2); -+ if (tempOpt != NULL){ -+ opt = tempOpt; -+ } else { -+ break; -+ } - opt = strcat(opt, " "); - opt = strcat(opt, arg[ii]); - ii++; diff --git a/0003-watchdog-5.13-rhsel.patch b/0003-watchdog-5.13-rhsel.patch new file mode 100644 index 0000000..49a7ecd --- /dev/null +++ b/0003-watchdog-5.13-rhsel.patch @@ -0,0 +1,34 @@ +diff -ur watchdog-5.15.old/src/test_binary.c watchdog-5.15/src/test_binary.c +--- watchdog-5.15.old/src/test_binary.c 2016-02-26 12:05:00.000000000 +0000 ++++ watchdog-5.15/src/test_binary.c 2018-02-13 08:51:27.292750445 +0000 +@@ -263,11 +263,11 @@ + * to cause trouble, so make them go to their respective files */ + strcpy(filename_buf, logdir); + strcat(filename_buf, "/test-bin.stdout"); +- if (!freopen(filename_buf, "a+", stdout)) ++ if (!freopen(filename_buf, "a", stdout)) + exit(errno); + strcpy(filename_buf, logdir); + strcat(filename_buf, "/test-bin.stderr"); +- if (!freopen(filename_buf, "a+", stderr)) ++ if (!freopen(filename_buf, "a", stderr)) + exit(errno); + + /* now start binary */ +diff -ur watchdog-5.15.old/src/watchdog.c watchdog-5.15/src/watchdog.c +--- watchdog-5.15.old/src/watchdog.c 2016-02-26 12:05:00.000000000 +0000 ++++ watchdog-5.15/src/watchdog.c 2018-02-13 08:51:43.747738628 +0000 +@@ -86,11 +86,11 @@ + * So make stdout and stderr go to their respective files */ + strcpy(filename_buf, logdir); + strcat(filename_buf, "/repair-bin.stdout"); +- if (!freopen(filename_buf, "a+", stdout)) ++ if (!freopen(filename_buf, "a", stdout)) + exit(errno); + strcpy(filename_buf, logdir); + strcat(filename_buf, "/repair-bin.stderr"); +- if (!freopen(filename_buf, "a+", stderr)) ++ if (!freopen(filename_buf, "a", stderr)) + exit(errno); + + /* now start binary */ diff --git a/0099-watchdog-5.16-rhseldoc.patch b/0004-watchdog-5.13-rhseldoc.patch similarity index 73% rename from 0099-watchdog-5.16-rhseldoc.patch rename to 0004-watchdog-5.13-rhseldoc.patch index decb8a8..3ccaf23 100644 --- a/0099-watchdog-5.16-rhseldoc.patch +++ b/0004-watchdog-5.13-rhseldoc.patch @@ -1,8 +1,7 @@ -diff --git a/watchdog.8 b/watchdog.8 -index 9b7c6e7..052b1e1 100644 ---- a/watchdog.8 -+++ b/watchdog.8 -@@ -216,6 +216,7 @@ by +diff -ur watchdog-5.15.old/watchdog.8 watchdog-5.15/watchdog.8 +--- watchdog-5.15.old/watchdog.8 2016-02-26 12:05:00.000000000 +0000 ++++ watchdog-5.15/watchdog.8 2018-02-13 08:54:00.860681339 +0000 +@@ -215,6 +215,7 @@ .BR watchdog . So you can for instance restart the server from your .IR repair-binary . @@ -10,7 +9,7 @@ index 9b7c6e7..052b1e1 100644 .PP .B watchdog will try periodically to fork itself to see whether the process -@@ -242,6 +243,8 @@ a given interface for traffic. If no traffic arrives the network is +@@ -241,6 +242,8 @@ considered unreachable causing a soft reboot or action from the repair binary. .PP @@ -19,7 +18,7 @@ index 9b7c6e7..052b1e1 100644 .B watchdog can run an external command for user-defined tests. A return code not equal 0 means an error occurred and watchdog should react. If the external command is -@@ -348,6 +351,9 @@ Child process did not return in time. +@@ -350,6 +353,9 @@ 246 Free for personal watchdog-specific use (was \-10 as an unsigned 8\-bit number). @@ -29,7 +28,7 @@ index 9b7c6e7..052b1e1 100644 .TP 245 Reserved for an unknown result, for example a slow background test that is -@@ -375,6 +381,9 @@ repair-maximum +@@ -377,6 +383,9 @@ controls the number of successive repair attempts that report 0 (i.e. success) but fail to clear the tested fault. If this is exceeded then a reboot takes place. If set to zero then a reboot can always be blocked by the repair program reporting success. @@ -39,7 +38,7 @@ index 9b7c6e7..052b1e1 100644 .SH "TEST DIRECTORY" Executables placed in the test directory are discovered by watchdog on startup and are automatically executed. They are bounded time-wise by -@@ -413,6 +422,27 @@ As for the repair binary, the configuration parameter +@@ -415,6 +424,27 @@ repair-maximum also controls the number of successive repair attempts that report success (return 0) but fail to clear the fault. @@ -67,30 +66,27 @@ index 9b7c6e7..052b1e1 100644 .SH BUGS None known so far. .SH AUTHORS -@@ -431,4 +461,4 @@ The watchdog device. +@@ -433,4 +463,4 @@ The pid file of the running .BR watchdog . .SH "SEE ALSO" -.BR watchdog.conf (5) +.BR watchdog.conf (5), systemd.unit (5) -diff --git a/watchdog.conf b/watchdog.conf -index 207da3e..7dd3cb3 100644 ---- a/watchdog.conf -+++ b/watchdog.conf -@@ -75,7 +75,9 @@ priority = 1 - # If you have a custom binary/script to handle errors then uncomment - # this line and provide the path. For 'v1' test binary files they also - # handle error cases. -- +diff -ur watchdog-5.15.old/watchdog.conf watchdog-5.15/watchdog.conf +--- watchdog-5.15.old/watchdog.conf 2016-02-26 12:05:00.000000000 +0000 ++++ watchdog-5.15/watchdog.conf 2018-02-13 08:52:18.899721271 +0000 +@@ -16,6 +16,8 @@ + #min-memory = 1 + #allocatable-memory = 1 + +# With enforcing SELinux policy please use the /usr/libexec/watchdog/scripts/ -+ +# or /etc/watchdog.d/ for your test-binary and repair-binary configuration. #repair-binary = /usr/sbin/repair #repair-timeout = 60 - -@@ -175,6 +177,13 @@ priority = 1 - #temperature-sensor = - #max-temperature = 90 + #test-binary = +@@ -45,5 +47,12 @@ + realtime = yes + priority = 1 +# When using custom service pid check with custom service +# systemd unit file please be aware the "Requires=" @@ -99,22 +95,20 @@ index 207da3e..7dd3cb3 100644 +# in the custom service unit file may be the desired operation instead. +# See man 5 systemd.unit for more details. +# - # Check for a running process/daemon by its PID file. For example, - # check if rsyslogd is still running by enabling the following line: - -diff --git a/watchdog.conf.5 b/watchdog.conf.5 -index edf7c8b..72c3bc2 100644 ---- a/watchdog.conf.5 -+++ b/watchdog.conf.5 -@@ -130,6 +130,7 @@ pidfile = - Set pidfile name for daemon test mode. - This option can be given as often as you like to check several daemons, assuming - they write their post-forking PID to the specified files. + # Check if rsyslogd is still running by enabling the following line + #pidfile = /var/run/rsyslogd.pid +diff -ur watchdog-5.15.old/watchdog.conf.5 watchdog-5.15/watchdog.conf.5 +--- watchdog-5.15.old/watchdog.conf.5 2016-02-26 12:05:00.000000000 +0000 ++++ watchdog-5.15/watchdog.conf.5 2018-02-13 08:52:18.898721271 +0000 +@@ -105,6 +105,7 @@ + pidfile = + Set pidfile name for server test mode. + This option can be given as often as you like to check several servers. +See the Systemd section in watchdog (8) for more information. .TP ping = Set IPv4 address for ping mode. -@@ -147,6 +148,8 @@ aliased IP interfaces. +@@ -119,6 +120,8 @@ .TP test-binary = Execute the given binary to do some user defined tests. @@ -123,7 +117,7 @@ index edf7c8b..72c3bc2 100644 .TP test-timeout = User defined tests may only run for seconds. Set to 0 for unlimited. -@@ -154,6 +157,8 @@ User defined tests may only run for seconds. Set to 0 for unlimited. +@@ -126,6 +129,8 @@ repair-binary = Execute the given binary in case of a problem instead of shutting down the system. @@ -132,7 +126,7 @@ index edf7c8b..72c3bc2 100644 .TP repair-timeout = repair command may only run for seconds. Set to 0 for 'unlimited', but -@@ -188,6 +193,7 @@ Set the schedule priority for realtime mode passed to sched_setscheduler(). +@@ -156,6 +161,7 @@ .TP test-directory = Set the directory to run user test/repair scripts. Default is '/etc/watchdog.d' diff --git a/sources b/sources index 14567dd..78f5706 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (watchdog-5.16.tar.gz) = 1c9c921570ec7ddc3e4ff88b2029f1c3865277e547fb8970575df4b61fdf1f06f443f49ad09f11c29d913ca7d6ab05c5b19ec049ac218a8bcebd20b1bf5f0bbd +SHA512 (watchdog-5.15.tar.gz) = a675cfadf3296d583b9163193297038fb19459daf7c6681289392d613e775e75b7afd42a3e01b136a955f25b2f45818033b56e10de9050075d7dc015535a6e75 diff --git a/watchdog.spec b/watchdog.spec index 7eca885..68a1bb9 100644 --- a/watchdog.spec +++ b/watchdog.spec @@ -1,30 +1,23 @@ Summary: Software and/or Hardware watchdog daemon Name: watchdog -Version: 5.16 -Release: 11%{?dist} -License: GPL-2.0-or-later +Version: 5.15 +Release: 3%{?dist} +License: GPLv2+ URL: http://sourceforge.net/projects/watchdog/ Source0: http://downloads.sourceforge.net/watchdog/watchdog-%{version}.tar.gz +Source1: watchdog.init Source2: README.watchdog.ipmi Source3: README.Fedora Source4: watchdog.service Source5: watchdog-ping.service -# Fixes building on glibc without RPC. Sent upstream 2019-02-06. -Patch1: 0001-Choose-libtirpc-or-another-RPC-library-for-XDR-heade.patch -# Fixes potentional mem leak -Patch2: 0002-mem-leak-verbose.patch +Patch3: 0003-watchdog-5.13-rhsel.patch +Patch4: 0004-watchdog-5.13-rhseldoc.patch -# Non-upstream patch to document SELinux support. -Patch99: 0099-watchdog-5.16-rhseldoc.patch - -BuildRequires: make BuildRequires: gcc BuildRequires: libtirpc-devel BuildRequires: systemd-units -# Required because patches touch configure.ac and Makefile.am: -BuildRequires: autoconf, automake Requires(post): systemd Requires(preun): systemd @@ -37,7 +30,7 @@ or may be alternately used with a hardware watchdog device such as the IPMI hardware watchdog driver interface to a resident Baseboard Management Controller (BMC). watchdog periodically writes to /dev/watchdog; the interval between writes to /dev/watchdog is configurable through settings -in the watchdog config file. This configuration file is also used to +in the watchdog sysconfig file. This configuration file is also used to set the watchdog to be used as a hardware watchdog instead of its default software watchdog operation. In either case, if the device is open but not written to within the configured time period, the watchdog timer expiration @@ -50,10 +43,8 @@ expiration) initiated by the BMC. %prep %setup -q -n %{name}-%{version} -%patch 1 -p1 -%patch 2 -p1 -%patch 99 -p1 -b .rhseldoc -autoreconf -i +%patch3 -p1 -b .rhsel +%patch4 -p1 -b .rhseldoc cp %{SOURCE2} . cp %{SOURCE3} . @@ -76,10 +67,10 @@ make %{?_smp_mflags} install -d -m0755 ${RPM_BUILD_ROOT}%{_sysconfdir} install -d -m0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/watchdog.d make DESTDIR=${RPM_BUILD_ROOT} install +install -Dp -m0644 %{name}.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/watchdog install -Dp -m0644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_unitdir}/watchdog.service install -Dp -m0644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_unitdir}/watchdog-ping.service install -Dd -m0755 ${RPM_BUILD_ROOT}%{_libexecdir}/watchdog/scripts -rm %{name}.sysconfig %post @@ -113,6 +104,7 @@ rm %{name}.sysconfig %doc README.Fedora %endif %config(noreplace) %{_sysconfdir}/watchdog.conf +%config(noreplace) %{_sysconfdir}/sysconfig/watchdog %{_sysconfdir}/watchdog.d %{_sbindir}/watchdog %{_sbindir}/wd_identify @@ -127,71 +119,8 @@ rm %{name}.sysconfig %changelog -* Fri Jul 25 2025 Fedora Release Engineering - 5.16-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sun Jan 19 2025 Fedora Release Engineering - 5.16-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Sat Jul 20 2024 Fedora Release Engineering - 5.16-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jan 27 2024 Fedora Release Engineering - 5.16-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sat Jul 22 2023 Fedora Release Engineering - 5.16-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Wed Jul 19 2023 Josef Ridky - 5.16-6 -- Migrate to SPDX license format - -* Sat Jan 21 2023 Fedora Release Engineering - 5.16-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 5.16-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Sat Jan 22 2022 Fedora Release Engineering - 5.16-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Thu Oct 14 2021 Josef Ridky - 5.16-2 -- fix memory leak when verbose mode is on - -* Tue Aug 10 2021 Josef Ridky - 5.16-1 -- New upstream release 5.16 - -* Fri Jul 23 2021 Fedora Release Engineering - 5.15-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 5.15-10 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Wed Jan 27 2021 Fedora Release Engineering - 5.15-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 5.15-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Mon Feb 03 2020 Václav Doležal - 5.15-7 -- Clean up old SysV-init related files - -* Fri Jan 31 2020 Fedora Release Engineering - 5.15-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Sat Jul 27 2019 Fedora Release Engineering - 5.15-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Wed Feb 06 2019 Richard W.M. Jones - 5.15-5 -- Add all upstream patches since 5.15. -- Fix RPC/libtirpc (again?). -- Remove .rhsel patch. Equivalent added upstream in 7310afccc1. - -* Sun Feb 03 2019 Fedora Release Engineering - 5.15-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Mon Dec 03 2018 Josef Ridky - 5.15-3 -- update service files (#1542632) +* Mon Aug 05 2019 Josef Ridky - 5.15-3 +- Remove obsolete statements from service files (#1690332) * Sat Jul 14 2018 Fedora Release Engineering - 5.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild