diff -r 4c677d990c98 tools/misc/Makefile --- a/tools/misc/Makefile Wed Jun 09 12:24:24 2010 +0200 +++ b/tools/misc/Makefile Wed Jun 09 13:54:27 2010 +0200 @@ -43,7 +43,11 @@ install: build $(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR) ifeq ($(CONFIG_Linux),y) $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d - $(INSTALL_PROG) xen-watchdog $(DESTDIR)$(CONFIG_DIR)/init.d + $(INSTALL_PROG) xen-watchdog-linux $(DESTDIR)$(CONFIG_DIR)/init.d/xen-watchdog +endif +ifeq ($(CONFIG_NetBSD),y) + $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d + $(INSTALL_PROG) xen-watchdog-netbsd $(DESTDIR)$(CONFIG_DIR)/rc.d/xen-watchdog endif set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done diff -r 4c677d990c98 tools/misc/xen-watchdog --- a/tools/misc/xen-watchdog Wed Jun 09 12:24:24 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -#! /bin/bash -# -# xen-watchdog -# -# chkconfig: 2345 21 79 -# description: Run domain watchdog daemon -# - -# Source function library. -. /etc/init.d/functions - -start() { - local r - base="watchdogd" - echo -n $"Starting domain watchdog daemon: " - - /usr/sbin/xenwatchdogd 30 15 - r=$? - [ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup" - echo - - return $r -} - -stop() { - local r - base="watchdogd" - echo -n $"Stopping domain watchdog daemon: " - - killall -USR1 watchdogd 2>/dev/null - r=$? - [ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop" - echo - - return $r -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - status) - ;; - condrestart) - stop - start - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart}" - exit 1 -esac - diff -r 4c677d990c98 tools/misc/xen-watchdog-linux --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/misc/xen-watchdog-linux Wed Jun 09 13:54:27 2010 +0200 @@ -0,0 +1,59 @@ +#! /bin/bash +# +# xen-watchdog +# +# chkconfig: 2345 21 79 +# description: Run domain watchdog daemon +# + +# Source function library. +. /etc/init.d/functions + +start() { + local r + base="watchdogd" + echo -n $"Starting domain watchdog daemon: " + + /usr/sbin/xenwatchdogd 30 15 + r=$? + [ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup" + echo + + return $r +} + +stop() { + local r + base="watchdogd" + echo -n $"Stopping domain watchdog daemon: " + + killall -USR1 watchdogd 2>/dev/null + r=$? + [ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop" + echo + + return $r +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + status) + ;; + condrestart) + stop + start + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart}" + exit 1 +esac + diff -r 4c677d990c98 tools/misc/xen-watchdog-netbsd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/misc/xen-watchdog-netbsd Wed Jun 09 13:54:27 2010 +0200 @@ -0,0 +1,23 @@ +#!/bin/sh +# +# PROVIDE: xen-watchdog +# REQUIRE: DAEMON +# +# description: Run domain watchdog daemon +# + +. /etc/rc.subr + +DIR=$(dirname "$0") +. "${DIR}/xen-hotplugpath.sh" + +LD_LIBRARY_PATH="${LIBDIR}" +export LD_LIBRARY_PATH + +name="xenwatchdog" +rcvar=$name +command="${SBINDIR}/xenwatchdogd" +start_cmd="echo Starting ${name}. && PATH=${PATH}:${SBINDIR} ${command} 30 15" + +load_rc_config $name +run_rc_command "$1"