[watchdog] - New upstream version 5.9 (RHBZ#645541). - Package new wd_identify program. - Drop old cleanup patc
Richard W.M. Jones
rjones at fedoraproject.org
Mon Jan 17 13:55:30 UTC 2011
commit ac9baefef014caa827620d41263a6a40281ce765
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Mon Jan 17 13:54:42 2011 +0000
- New upstream version 5.9 (RHBZ#645541).
- Package new wd_identify program.
- Drop old cleanup patch, most of it is now upstream.
- Add newer cleanup patch, sent upstream.
- Fix some problems with the initscript (RHBZ#523391).
- Add systemd service (file installed but not used) (RHBZ#661220).
.gitignore | 1 +
sources | 2 +-
watchdog-5.5-cleanup.patch | 419 ---------------------------
watchdog-5.9-cleanups.patch | 70 +++++
watchdog-5.9-write-warn-unused-result.patch | 28 ++
watchdog.init | 11 +-
watchdog.service | 10 +
watchdog.spec | 30 ++-
8 files changed, 143 insertions(+), 428 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b65cc05..ad7b606 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
watchdog-5.5.tar.gz
+/watchdog-5.9.tar.gz
diff --git a/sources b/sources
index ee5a4d5..00a1aca 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f4fbb3465bdc0d0ac27bdd2972f7f469 watchdog-5.5.tar.gz
+d7cae3c9829f5d9a680764f314234867 watchdog-5.9.tar.gz
diff --git a/watchdog-5.9-cleanups.patch b/watchdog-5.9-cleanups.patch
new file mode 100644
index 0000000..28bd75c
--- /dev/null
+++ b/watchdog-5.9-cleanups.patch
@@ -0,0 +1,70 @@
+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 <stdlib.h>
+ #include <libgen.h>
+ #include <getopt.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
+
+ #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 <stdio.h>
+ #include <stdlib.h>
+ #include <sys/mman.h>
++#include <sys/ioctl.h>
+ #include <sys/wait.h>
+ #include <linux/watchdog.h>
+ #include <libgen.h>
+@@ -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
new file mode 100644
index 0000000..5a8b528
--- /dev/null
+++ b/watchdog-5.9-write-warn-unused-result.patch
@@ -0,0 +1,28 @@
+--- 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.init b/watchdog.init
index 7f32bb3..3c5cf6a 100644
--- a/watchdog.init
+++ b/watchdog.init
@@ -1,10 +1,13 @@
#! /bin/sh
#
+# watchdog - a watchdog daemon
+#
# chkconfig: - 27 46
-# description: A software watchdog
+# description: A watchdog daemon
#
# rc file author: Marc Merlin <marcsoft at merlins.org>
# Henning P. Schmiedehausen <hps at tanstaafl.de>
+# Richard W.M. Jones <rjones at redhat.com>
# Source function library.
. /etc/rc.d/init.d/functions
@@ -36,10 +39,10 @@ start() {
daemon /usr/sbin/${prog}
fi
RETVAL=$?
+ echo
[ $RETVAL -eq 0 ] && touch $lockfile
[ $RETVAL -eq 0 ] && echo_success
[ $RETVAL -ne 0 ] && echo_failure
- echo
return $RETVAL
}
@@ -73,7 +76,7 @@ case "$1" in
;;
condrestart)
if [ -f $lockfile ]; then
- restart
+ restart
fi
;;
status)
@@ -84,3 +87,5 @@ case "$1" in
echo $"Usage: $0 {start|stop|restart|status|condrestart}"
exit 1
esac
+
+exit $RETVAL
diff --git a/watchdog.service b/watchdog.service
new file mode 100644
index 0000000..4648eb6
--- /dev/null
+++ b/watchdog.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=software watchdog
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/watchdog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/watchdog.spec b/watchdog.spec
index 512e2b9..822ddbf 100644
--- a/watchdog.spec
+++ b/watchdog.spec
@@ -1,7 +1,7 @@
Summary: Software and/or Hardware watchdog daemon
Name: watchdog
-Version: 5.5
-Release: 7%{?dist}
+Version: 5.9
+Release: 1%{?dist}
License: GPL+
Group: System Environment/Daemons
@@ -10,8 +10,14 @@ Source0: http://downloads.sourceforge.net/watchdog/watchdog-%{version}.
Source1: watchdog.init
Source2: README.watchdog.ipmi
Source3: README.Fedora
+Source4: watchdog.service
-Patch0: %{name}-%{version}-cleanup.patch
+# 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)
@@ -41,11 +47,12 @@ expiration) initiated by the BMC.
%prep
%setup -q -n %{name}-%{version}
+%patch0 -p1
+%patch1 -p1
+
cp %{SOURCE2} .
cp %{SOURCE3} .
-%patch0 -p1 -b .cleanup
-
mv README README.orig
iconv -f ISO-8859-1 -t UTF-8 < README.orig > README
@@ -61,6 +68,8 @@ 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}/lib/systemd/system/watchdog.service
+
%clean
rm -Rf ${RPM_BUILD_ROOT}
@@ -92,13 +101,24 @@ fi
%config(noreplace) %{_sysconfdir}/sysconfig/watchdog
%{_sysconfdir}/rc.d/init.d/watchdog
%{_sbindir}/watchdog
+%{_sbindir}/wd_identify
%{_sbindir}/wd_keepalive
%{_mandir}/man5/watchdog.conf.5*
%{_mandir}/man8/watchdog.8*
+%{_mandir}/man8/wd_identify.8*
%{_mandir}/man8/wd_keepalive.8*
+/lib/systemd/system/watchdog.service
%changelog
+* Mon Jan 17 2011 Richard W.M. Jones <rjones at redhat.com> - 5.9-1
+- New upstream version 5.9 (RHBZ#645541).
+- Package new wd_identify program.
+- Drop old cleanup patch, most of it is now upstream.
+- Add newer cleanup patch, sent upstream.
+- Fix some problems with the initscript (RHBZ#523391).
+- Add systemd service (file installed but not used) (RHBZ#661220).
+
* Wed Jan 13 2010 Richard W.M. Jones <rjones at redhat.com> - 5.5-7
- Fix Source0 URL.
More information about the scm-commits
mailing list