diff options
author | Lars Wendler <polynomial-c@gentoo.org> | 2016-03-01 08:38:41 +0100 |
---|---|---|
committer | Lars Wendler <polynomial-c@gentoo.org> | 2016-03-01 08:54:30 +0100 |
commit | a38428a032bde813630b4670454588dc1d8581f8 (patch) | |
tree | 23ae406fa621cf68a3cfd9c33f0895afc1211b2e /sys-apps/watchdog/files | |
parent | sys-apps/less: Removed old. (diff) | |
download | gentoo-a38428a032bde813630b4670454588dc1d8581f8.tar.gz gentoo-a38428a032bde813630b4670454588dc1d8581f8.tar.bz2 gentoo-a38428a032bde813630b4670454588dc1d8581f8.zip |
sys-apps/watchdog: Bump to version 5.15
Package-Manager: portage-2.2.27
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'sys-apps/watchdog/files')
-rw-r--r-- | sys-apps/watchdog/files/watchdog-init.d-r1 | 44 |
1 files changed, 44 insertions, 0 deletions
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..79602017ac34 --- /dev/null +++ b/sys-apps/watchdog/files/watchdog-init.d-r1 @@ -0,0 +1,44 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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 $? +} |