From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../watchdog/files/watchdog-5.15-musl-nfs.patch | 27 +++++++++++++ sys-apps/watchdog/files/watchdog-5.15-musl.patch | 23 +++++++++++ sys-apps/watchdog/files/watchdog-conf.d | 5 +++ sys-apps/watchdog/files/watchdog-init.d | 47 ++++++++++++++++++++++ sys-apps/watchdog/files/watchdog-init.d-r1 | 43 ++++++++++++++++++++ sys-apps/watchdog/files/watchdog.service | 10 +++++ 6 files changed, 155 insertions(+) create mode 100644 sys-apps/watchdog/files/watchdog-5.15-musl-nfs.patch create mode 100644 sys-apps/watchdog/files/watchdog-5.15-musl.patch create mode 100644 sys-apps/watchdog/files/watchdog-conf.d create mode 100644 sys-apps/watchdog/files/watchdog-init.d create mode 100644 sys-apps/watchdog/files/watchdog-init.d-r1 create mode 100644 sys-apps/watchdog/files/watchdog.service (limited to 'sys-apps/watchdog/files') diff --git a/sys-apps/watchdog/files/watchdog-5.15-musl-nfs.patch b/sys-apps/watchdog/files/watchdog-5.15-musl-nfs.patch new file mode 100644 index 000000000000..bee4ddc8d7bc --- /dev/null +++ b/sys-apps/watchdog/files/watchdog-5.15-musl-nfs.patch @@ -0,0 +1,27 @@ +commit f52c40680f0aad44b9ae16648803453ec00cbb2c +Author: Paul Crawford +Date: Fri Dec 30 15:55:45 2016 +0000 + + Compile with musl when nfs is disabled + + musl does by default not ship with rpc headers. The watchdog should + not require rpc headers when nfs support is disabled. + + Patch by Felix Janda + +diff --git a/include/sundries.h b/include/sundries.h +index 4379982..98c489a 100644 +--- a/include/sundries.h ++++ b/include/sundries.h +@@ -9,9 +9,11 @@ + #include + #include + #include ++#if HAVE_NFS + #if !defined(bool_t) && !defined(__GLIBC__) + #include + #endif ++#endif + + extern int mount_mount_quiet; + extern int mount_verbose; diff --git a/sys-apps/watchdog/files/watchdog-5.15-musl.patch b/sys-apps/watchdog/files/watchdog-5.15-musl.patch new file mode 100644 index 000000000000..ae62c8014e5b --- /dev/null +++ b/sys-apps/watchdog/files/watchdog-5.15-musl.patch @@ -0,0 +1,23 @@ +commit c5cb4e1a0339844ae3f55ff1dc4a716c28012f05 +Author: Paul Crawford +Date: Tue Jun 28 18:08:48 2016 +0100 + + Include linux/param.h for EXEC_PAGESIZE definition + + Musl does not include linux/param.h whereas glibc does, so it fails + to build on musl. Patch supplied by Khem Raj + +diff --git a/src/watchdog.c b/src/watchdog.c +index acf6450..486384a 100644 +--- a/src/watchdog.c ++++ b/src/watchdog.c +@@ -26,6 +26,9 @@ + #include /* For EXEC_PAGESIZE */ + #include + #include ++#ifdef __linux__ ++#include ++#endif + #include + + #include diff --git a/sys-apps/watchdog/files/watchdog-conf.d b/sys-apps/watchdog/files/watchdog-conf.d new file mode 100644 index 000000000000..39c0f808eff0 --- /dev/null +++ b/sys-apps/watchdog/files/watchdog-conf.d @@ -0,0 +1,5 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# for more info, see watchdog(8) +WATCHDOG_OPTS="" diff --git a/sys-apps/watchdog/files/watchdog-init.d b/sys-apps/watchdog/files/watchdog-init.d new file mode 100644 index 000000000000..734a02cdbcbe --- /dev/null +++ b/sys-apps/watchdog/files/watchdog-init.d @@ -0,0 +1,47 @@ +#!/sbin/openrc-run +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need localmount + use logger +} + +get_config() { + set -- ${WATCHDOG_OPTS} + while [ -n "$1" ] ; do + if [ "$1" = "-c" -o "$1" = "--config-file" ] ; then + echo $2 + return + fi + shift + done + echo /etc/watchdog.conf +} + +get_delay() { + # man this is fugly + sed -n \ + -e '1{x;s:.*:10:;x}' \ + -e 's:#.*::' \ + -e 's:^[[:space:]]*::' \ + -e '/^interval/{s:.*=::;h}' \ + -e '${g;p}' \ + $(get_config) +} + +start() { + ebegin "Starting watchdog" + start-stop-daemon --start \ + --exec /usr/sbin/watchdog --pidfile /var/run/watchdog.pid \ + -- ${WATCHDOG_OPTS} + eend $? +} + +stop() { + ebegin "Stopping watchdog" + start-stop-daemon --stop \ + --exec /usr/sbin/watchdog --pidfile /var/run/watchdog.pid \ + --retry $(get_delay) + eend $? +} diff --git a/sys-apps/watchdog/files/watchdog-init.d-r1 b/sys-apps/watchdog/files/watchdog-init.d-r1 new file mode 100644 index 000000000000..363c8be9bd24 --- /dev/null +++ b/sys-apps/watchdog/files/watchdog-init.d-r1 @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +pidfile="/var/run/watchdog.pid" +command="/usr/sbin/watchdog" +command_args="${WATCHDOG_OPTS}" + +depend() { + need localmount + use logger +} + +get_config() { + set -- ${WATCHDOG_OPTS} + while [ -n "$1" ] ; do + if [ "$1" = "-c" -o "$1" = "--config-file" ] ; then + echo $2 + return + fi + shift + done + echo /etc/watchdog.conf +} + +get_delay() { + # man this is fugly + sed -n \ + -e '1{x;s:.*:10:;x}' \ + -e 's:#.*::' \ + -e 's:^[[:space:]]*::' \ + -e '/^interval/{s:.*=::;h}' \ + -e '${g;p}' \ + $(get_config) +} + +stop() { + ebegin "Stopping watchdog" + start-stop-daemon --stop \ + --exec ${command} --pidfile ${pidfile} \ + --retry $(get_delay) + eend $? +} diff --git a/sys-apps/watchdog/files/watchdog.service b/sys-apps/watchdog/files/watchdog.service new file mode 100644 index 000000000000..9ec1076e6689 --- /dev/null +++ b/sys-apps/watchdog/files/watchdog.service @@ -0,0 +1,10 @@ +[Unit] +Description=watchdog daemon +After=syslog.target + +[Service] +Type=forking +ExecStart=/usr/sbin/watchdog + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3