- 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).
This commit is contained in:
parent
ae9505a506
commit
af4e55c497
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
watchdog-5.5.tar.gz
|
||||
/watchdog-5.9.tar.gz
|
||||
/watchdog-5.12.tar.gz
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
d7cae3c9829f5d9a680764f314234867 watchdog-5.9.tar.gz
|
||||
cea28bea70e54f3625062bc808aef9af watchdog-5.12.tar.gz
|
||||
|
@ -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 <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);
|
||||
}
|
||||
|
@ -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);
|
@ -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 <rjones@redhat.com> - 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 <limburgher@gmail.com> - 5.9-4
|
||||
- Migrate to systemd, BZ 661220.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user