diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-05-16 16:59:26 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-05-16 16:59:26 +0000 |
commit | ddd8db58f518ad7114bd438bd84365165d9db970 (patch) | |
tree | b9c3d77a0d77e9ce9c4683ed7e082ecdc8c102da /sys-apps | |
parent | old (diff) | |
download | gentoo-2-ddd8db58f518ad7114bd438bd84365165d9db970.tar.gz gentoo-2-ddd8db58f518ad7114bd438bd84365165d9db970.tar.bz2 gentoo-2-ddd8db58f518ad7114bd438bd84365165d9db970.zip |
Use --pidfile with ssd, as well as a better --retry value #269697 by Jerome Venturi.
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps')
-rw-r--r-- | sys-apps/watchdog/ChangeLog | 6 | ||||
-rw-r--r-- | sys-apps/watchdog/files/watchdog-init.d | 37 |
2 files changed, 36 insertions, 7 deletions
diff --git a/sys-apps/watchdog/ChangeLog b/sys-apps/watchdog/ChangeLog index 385dea699c57..26f580e913d2 100644 --- a/sys-apps/watchdog/ChangeLog +++ b/sys-apps/watchdog/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-apps/watchdog # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/watchdog/ChangeLog,v 1.26 2009/03/22 22:12:34 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/watchdog/ChangeLog,v 1.27 2009/05/16 16:59:26 vapier Exp $ + + 16 May 2009; Mike Frysinger <vapier@gentoo.org> files/watchdog-init.d: + Use --pidfile with ssd, as well as a better --retry value #269697 by + Jerome Venturi. *watchdog-5.6 (22 Mar 2009) diff --git a/sys-apps/watchdog/files/watchdog-init.d b/sys-apps/watchdog/files/watchdog-init.d index 03cd7c2cb110..b3fa9f6e3cae 100644 --- a/sys-apps/watchdog/files/watchdog-init.d +++ b/sys-apps/watchdog/files/watchdog-init.d @@ -1,22 +1,47 @@ #!/sbin/runscript -# Copyright 1999-2006 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/watchdog/files/watchdog-init.d,v 1.1 2006/07/13 17:16:49 phreak Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/watchdog/files/watchdog-init.d,v 1.2 2009/05/16 16:59:26 vapier Exp $ 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 + 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 --quiet --exec /usr/sbin/watchdog \ + start-stop-daemon --start \ + --exec /usr/sbin/watchdog --pidfile /var/run/watchdog.pid \ -- ${WATCHDOG_OPTS} - eend ${?} + eend $? } stop() { ebegin "Stopping watchdog" - start-stop-daemon --stop --retry 5 --quiet --exec /usr/sbin/watchdog - eend ${?} + start-stop-daemon --stop \ + --exec /usr/sbin/watchdog --pidfile /var/run/watchdog.pid \ + --retry $(get_delay) + eend $? } |