I was surprised we were missing this one

OBS-URL: https://build.opensuse.org/package/show/Base:System/watchdog?expand=0&rev=1
This commit is contained in:
Marcus Meissner 2018-05-28 17:37:25 +00:00 committed by Git OBS Bridge
commit 6a34bf73f6
9 changed files with 299 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

3
watchdog-5.15.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ffdc865137ad5d8e53664bd22bad4de6ca136d1b4636720320cb52af0c18947c
size 228132

31
watchdog-initscript.diff Normal file
View File

@ -0,0 +1,31 @@
--- watchdog-5.15/suse/rc.watchdog.suse 2018/05/22 23:09:48 1.1
+++ watchdog-5.15/suse/rc.watchdog.suse 2018/05/22 23:15:09
@@ -4,14 +4,25 @@
# Author: Thorsten Bonow (Toto) <tb@lmbau.rwth-aachen.de>, 2000
# Based on example /sbin/init.d/skeleton=20
#
-# /sbin/init.d/<watchdog.toto>
+# /sbin/init.d/watchdog
#
# and symbolic its link
#
-# /sbin/rc<watchdog.toto>
+# /sbin/rcwatchdog
#
+### BEGIN INIT INFO
+# Provides: watchdog
+# Required-Start: $time $syslog
+# Required-Stop: $time $syslog
+# Should-Start: $none
+# Should-Stop: $none
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 4 6
+# Description: Watchdog Daemon
+### END INIT INFO
-. /etc/rc.config
+
+. /etc/rc.status
# Determine the base and follow a runlevel link name.
base=${0##*/}

12
watchdog-ping.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=watchdog daemon for use with ping test / network dependency
After=network.target
Conflicts=watchdog.service
[Service]
Type=forking
ExecStart=/usr/sbin/watchdog
ControlGroup=cpu:/
[Install]
WantedBy=multi-user.target

40
watchdog-sysconfdir.diff Normal file
View File

@ -0,0 +1,40 @@
--- watchdog-5.15/configure.ac 2016-02-26 23:05:00.000000000 +1100
+++ watchdog-new/configure.ac 2016-11-26 13:42:20.236621454 +1100
@@ -105,7 +105,7 @@
CONFIG_FILENAME="$withval"
AC_MSG_RESULT($withval)
],[
- CONFIG_FILENAME="/etc/watchdog.conf"
+ CONFIG_FILENAME="$sysconfdir/watchdog.conf"
AC_DEFINE_UNQUOTED(CONFIG_FILENAME, "$CONFIG_FILENAME", "name of config file")
AC_MSG_RESULT($CONFIG_FILENAME)
])
@@ -119,7 +119,7 @@
TESTBIN_PATH="$withval"
AC_MSG_RESULT($withval)
],[
- TESTBIN_PATH="/etc/watchdog.d"
+ TESTBIN_PATH="$sysconfdir/watchdog.d"
AC_DEFINE_UNQUOTED(TESTBIN_PATH, "$TESTBIN_PATH", "path to test binaries")
AC_MSG_RESULT($TESTBIN_PATH)
])
--- watchdog-5.15/configure 2016-02-26 23:05:14.000000000 +1100
+++ watchdog-new/configure 2016-11-26 13:57:12.585234585 +1100
@@ -5368,7 +5368,7 @@
else
- CONFIG_FILENAME="/etc/watchdog.conf"
+ CONFIG_FILENAME="$sysconfdir/watchdog.conf"
cat >>confdefs.h <<_ACEOF
#define CONFIG_FILENAME "$CONFIG_FILENAME"
@@ -5398,7 +5398,7 @@
else
- TESTBIN_PATH="/etc/watchdog.d"
+ TESTBIN_PATH="$sysconfdir/watchdog.d"
cat >>confdefs.h <<_ACEOF
#define TESTBIN_PATH "$TESTBIN_PATH"

31
watchdog.changes Normal file
View File

@ -0,0 +1,31 @@
-------------------------------------------------------------------
Thu May 24 13:37:18 CEST 2018 - ro@suse.de
- readd BuildRoot for sle11 build
-------------------------------------------------------------------
Thu May 24 13:25:10 CEST 2018 - ro@suse.de
- add systemd support: copy unit files from fedora package
-------------------------------------------------------------------
Wed May 23 01:10:33 CEST 2018 - ro@suse.de
- add patch watchdog-initscript.diff
-------------------------------------------------------------------
Wed May 23 01:07:05 CEST 2018 - ro@suse.de
- add initscript
-------------------------------------------------------------------
Wed May 23 00:53:46 CEST 2018 - ro@suse.de
- disable nfs, would need libtirpc, not used now
-------------------------------------------------------------------
Mon Nov 21 00:33:06 CEST 2016 - furlongm@gmail.com
- Initial OBS release (version 5.15)

12
watchdog.service Normal file
View File

@ -0,0 +1,12 @@
[Unit]
Description=watchdog daemon
# man systemd.special
# auto added After=basic.target
[Service]
Type=forking
ExecStart=/usr/sbin/watchdog
ControlGroup=cpu:/
[Install]
WantedBy=multi-user.target

146
watchdog.spec Normal file
View File

@ -0,0 +1,146 @@
#
# spec file for package watchdog
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%if 0%{?suse_version} >= 1220
%define with_systemd 1
%else
%define with_systemd 0
%endif
%if 0%{?suse_version} >= 1500
%define with_tirpc 1
%else
%define with_tirpc 0
%endif
Summary: Software and/or Hardware watchdog daemon
Name: watchdog
Version: 5.15
Release: 1
License: GPL-2.0
Group: System/Daemons
Url: http://sourceforge.net/projects/watchdog/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.gz
Source4: watchdog.service
Source5: watchdog-ping.service
Patch0: watchdog-sysconfdir.diff
Patch1: watchdog-initscript.diff
%if %{with_tirpc}
BuildRequires: libtirpc-devel
%endif
%if %{with_systemd}
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%endif
%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
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 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
will trigger a machine reboot. When operating as a software watchdog, the
ability to reboot will depend on the state of the machine and interrupts.
When operating as a hardware watchdog, the machine will experience a hard
reset (or whatever action was configured to be taken upon watchdog timer
expiration) initiated by the BMC.
%prep
%setup -q -n %{name}-%{version}
mv README README.orig
iconv -f ISO-8859-1 -t UTF-8 < README.orig > README
%patch0 -p1
%patch1 -p1
%build
%configure \
%if %{with_tirpc}
CFLAGS="$CFLAGS -I/usr/include/tirpc" \
LIBS="$LIBS -ltirpc"
%endif
%__make %{?_smp_mflags}
%install
install -d -m0755 %{buildroot}%{_sysconfdir}
make DESTDIR=%{buildroot} install
%if %{with_systemd}
install -Dp -m0644 %{SOURCE4} %{buildroot}%{_unitdir}/watchdog.service
install -Dp -m0644 %{SOURCE5} %{buildroot}%{_unitdir}/watchdog-ping.service
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcwatchdog
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rcwatchdog-ping
%else
install -d -m0755 %{buildroot}%{_sysconfdir}/init.d
install -m0755 suse/rc.watchdog.suse %{buildroot}%{_sysconfdir}/init.d/watchdog
ln -sf ../../%{_sysconfdir}/init.d/watchdog %{buildroot}/%{_sbindir}/rcwatchdog
%endif
%pre
%if %{with_systemd}
%service_add_pre %{name}.service watchdog-ping.service
%endif
%post
%if %{with_systemd}
%service_add_post %{name}.service watchdog-ping.service
%endif
%preun
%if %{with_systemd}
%service_del_preun %{name}.service watchdog-ping.service
%else
%{stop_on_removal %{name}}
%endif
%postun
%if %{with_systemd}
%service_del_postun %{name}.service watchdog-ping.service
%else
%{restart_on_update %{name}}
%{insserv_cleanup}
%endif
%files
%defattr(-, root, root, -)
%doc AUTHORS ChangeLog COPYING examples/ IAFA-PACKAGE NEWS README TODO README.watchdog.ipmi
%config(noreplace) %{_sysconfdir}/watchdog.conf
%if %{with_systemd}
%{_unitdir}/watchdog.service
%{_unitdir}/watchdog-ping.service
%{_sbindir}/rcwatchdog-ping
%else
%{_sysconfdir}/init.d/watchdog
%endif
%{_sbindir}/rcwatchdog
%{_sbindir}/watchdog
%{_sbindir}/wd_keepalive
%{_sbindir}/wd_identify
%{_mandir}/man5/watchdog.conf.5*
%{_mandir}/man8/watchdog.8*
%{_mandir}/man8/wd_keepalive.8*
%{_mandir}/man8/wd_identify.8*
%changelog