From af4e55c497ac49cda487d0c693437f53a2e636db Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 6 Jul 2012 09:05:46 +0100 Subject: [PATCH] - New upstream version 5.12 (RHBZ#837949). - Bring specfile up to modern standards. - Remove commented sections from previous commit. - Remove both patches (equivalent changes now upstream). --- .gitignore | 1 + sources | 2 +- watchdog-5.9-cleanups.patch | 70 --------------------- watchdog-5.9-write-warn-unused-result.patch | 28 --------- watchdog.spec | 47 +++----------- 5 files changed, 12 insertions(+), 136 deletions(-) delete mode 100644 watchdog-5.9-cleanups.patch delete mode 100644 watchdog-5.9-write-warn-unused-result.patch diff --git a/.gitignore b/.gitignore index ad7b606..5f3fa94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ watchdog-5.5.tar.gz /watchdog-5.9.tar.gz +/watchdog-5.12.tar.gz diff --git a/sources b/sources index 00a1aca..0a8d1fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -d7cae3c9829f5d9a680764f314234867 watchdog-5.9.tar.gz +cea28bea70e54f3625062bc808aef9af watchdog-5.12.tar.gz diff --git a/watchdog-5.9-cleanups.patch b/watchdog-5.9-cleanups.patch deleted file mode 100644 index 28bd75c..0000000 --- a/watchdog-5.9-cleanups.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -ur watchdog-5.9.old/src/watchdog.c watchdog-5.9.cleanups/src/watchdog.c ---- watchdog-5.9.old/src/watchdog.c 2010-06-16 14:45:51.000000000 +0100 -+++ watchdog-5.9.cleanups/src/watchdog.c 2011-01-17 13:53:22.268899519 +0000 -@@ -638,7 +638,7 @@ - * if the system runs out of memory */ - filename_buf = (char*)malloc(max(strlen(logdir) + sizeof("/repair-bin.stdout") + 1, strlen("/proc//oom_adj") + sizeof(int) * CHAR_BIT * 10 / 3 + 1)); - if (!filename_buf) { -- error(progname); -+ perror(progname); - exit(1); - } - -@@ -713,7 +713,7 @@ - for (act = iface; act != NULL; act = act->next) - syslog(LOG_INFO, "interface: %s", act->name); - -- syslog(LOG_INFO, "test=%s(%ld) repair=%s(%d) alive=%s heartbeat=%s temp=%s to=%s no_act=%s", -+ syslog(LOG_INFO, "test=%s(%ld) repair=%s(%ld) alive=%s heartbeat=%s temp=%s to=%s no_act=%s", - (tbinary == NULL) ? "none" : tbinary, timeout, - (rbinary == NULL) ? "none" : rbinary, rtimeout, - (devname == NULL) ? "none" : devname, -@@ -947,4 +947,5 @@ - - terminate(); - /* not reached */ -+ exit (EXIT_SUCCESS); - } -diff -ur watchdog-5.9.old/src/wd_identify.c watchdog-5.9.cleanups/src/wd_identify.c ---- watchdog-5.9.old/src/wd_identify.c 2010-06-17 16:21:06.000000000 +0100 -+++ watchdog-5.9.cleanups/src/wd_identify.c 2011-01-17 13:44:52.016374800 +0000 -@@ -20,6 +20,8 @@ - #include - #include - #include -+#include -+#include - - #define DEVICE "watchdog-device" - -@@ -125,10 +127,7 @@ - - int main(int argc, char *const argv[]) - { -- FILE *fp; - char *configfile = CONFIG_FILENAME; -- char *filename_buf; -- int count = 0; - int c; - struct watchdog_info ident; - char *opts = "c:"; -diff -ur watchdog-5.9.old/src/wd_keepalive.c watchdog-5.9.cleanups/src/wd_keepalive.c ---- watchdog-5.9.old/src/wd_keepalive.c 2010-06-16 14:45:49.000000000 +0100 -+++ watchdog-5.9.cleanups/src/wd_keepalive.c 2011-01-17 13:43:38.829707725 +0000 -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -286,7 +287,7 @@ - * if the system runs out of memory */ - filename_buf = (char*)malloc(strlen("/proc//oom_adj") + sizeof(int) * CHAR_BIT * 10 / 3 + 1); - if (!filename_buf) { -- error(progname); -+ perror(progname); - exit(1); - } - diff --git a/watchdog-5.9-write-warn-unused-result.patch b/watchdog-5.9-write-warn-unused-result.patch deleted file mode 100644 index 5a8b528..0000000 --- a/watchdog-5.9-write-warn-unused-result.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- watchdog-5.9.old/src/shutdown.c 2010-03-06 21:06:51.000000000 +0000 -+++ watchdog-5.9.cleanups/src/shutdown.c 2011-01-17 13:41:57.623877045 +0000 -@@ -336,6 +336,7 @@ - void do_shutdown(int errorcode) - { - int i = 0, fd; -+ size_t write_len; - char *seedbck = RANDOM_SEED; - - /* soft-boot the system */ -@@ -459,7 +460,7 @@ - wtmp.ut_pid = 0; - wtmp.ut_type = RUN_LVL; - wtmp.ut_time = t; -- write(fd, (char *) &wtmp, sizeof(wtmp)); -+ write_len = write(fd, (char *) &wtmp, sizeof(wtmp)); - close(fd); - } - -@@ -475,7 +476,7 @@ - char buf[512]; - - if (read(fd_seed, buf, 512) == 512) -- write(fd_bck, buf, 512); -+ write_len = write(fd_bck, buf, 512); - close(fd_bck); - } - close(fd_seed); diff --git a/watchdog.spec b/watchdog.spec index 2617af4..85d0a76 100644 --- a/watchdog.spec +++ b/watchdog.spec @@ -1,7 +1,7 @@ Summary: Software and/or Hardware watchdog daemon Name: watchdog -Version: 5.9 -Release: 4%{?dist} +Version: 5.12 +Release: 1%{?dist} License: GPL+ Group: System Environment/Daemons @@ -12,23 +12,11 @@ Source2: README.watchdog.ipmi Source3: README.Fedora Source4: watchdog.service -# This was sent upstream as part of a large bundle of cleanups, but -# this part was not applied, so I assume they don't want it. -Patch0: watchdog-5.9-write-warn-unused-result.patch - -# Sent upstream on 2011-01-17. -Patch1: watchdog-5.9-cleanups.patch - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -#Requires(post): /sbin/chkconfig -#Requires(postun): /sbin/chkconfig -#Requires(post): /sbin/service -#Requires(postun): /sbin/service Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units + %description The watchdog program can be used as a powerful software watchdog daemon or may be alternately used with a hardware watchdog device such as the @@ -49,9 +37,6 @@ expiration) initiated by the BMC. %prep %setup -q -n %{name}-%{version} -%patch0 -p1 -%patch1 -p1 - cp %{SOURCE2} . cp %{SOURCE3} . @@ -65,32 +50,20 @@ make %{?_smp_mflags} %install -rm -Rf ${RPM_BUILD_ROOT} install -d -m0755 ${RPM_BUILD_ROOT}%{_sysconfdir} make DESTDIR=${RPM_BUILD_ROOT} install install -Dp -m0644 %{name}.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/watchdog -#install -Dp -m0755 %%{SOURCE1} ${RPM_BUILD_ROOT}%%{_initrddir}/watchdog install -Dp -m0644 %{SOURCE4} ${RPM_BUILD_ROOT}%{_unitdir}/watchdog.service -%clean -rm -Rf ${RPM_BUILD_ROOT} - - %post -#if [ $1 -eq 1 ]; then -# /sbin/chkconfig --add %{name} -#fi if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi + %preun -#if [ $1 -eq 0 ]; then -# /sbin/service %{name} stop >/dev/null 2>&1 -# /sbin/chkconfig --del %{name} -#fi if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable watchdog.service > /dev/null 2>&1 || : @@ -98,11 +71,7 @@ if [ $1 -eq 0 ] ; then fi - %postun -#if [ $1 -ge 1 ]; then -# /sbin/service %{name} condrestart >/dev/null 2>&1 -#fi /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall @@ -121,11 +90,9 @@ fi %files -%defattr(-, root, root, -) %doc AUTHORS ChangeLog COPYING examples/ IAFA-PACKAGE NEWS README TODO README.watchdog.ipmi README.Fedora %config(noreplace) %{_sysconfdir}/watchdog.conf %config(noreplace) %{_sysconfdir}/sysconfig/watchdog -#%%{_sysconfdir}/rc.d/init.d/watchdog %{_sbindir}/watchdog %{_sbindir}/wd_identify %{_sbindir}/wd_keepalive @@ -137,6 +104,12 @@ fi %changelog +* Fri Jul 06 2012 Richard W.M. Jones - 5.12-1 +- New upstream version 5.12 (RHBZ#837949). +- Bring specfile up to modern standards. +- Remove commented sections from previous commit. +- Remove both patches (equivalent changes now upstream). + * Wed Mar 14 2012 Jon Ciesla - 5.9-4 - Migrate to systemd, BZ 661220.