From: Keir Fraser Date: Wed, 9 Jun 2010 12:29:22 +0000 (+0100) Subject: xen-watchdog: Move init script to OS-dep dir and implement for netbsd X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11972 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bce846e928e960e912d151ee041bc736e615eab5;p=xen.git xen-watchdog: Move init script to OS-dep dir and implement for netbsd Signed-off-by: Christoph Egger Signed-off-by: Keir Fraser --- diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile index 99749fae89..19d88ab87d 100644 --- a/tools/hotplug/Linux/Makefile +++ b/tools/hotplug/Linux/Makefile @@ -71,6 +71,7 @@ install-initd: $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d $(INSTALL_PROG) $(XENCOMMONS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xencommons + $(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(CONFIG_DIR)/init.d .PHONY: install-scripts install-scripts: diff --git a/tools/hotplug/Linux/init.d/xen-watchdog b/tools/hotplug/Linux/init.d/xen-watchdog new file mode 100644 index 0000000000..417b451922 --- /dev/null +++ b/tools/hotplug/Linux/init.d/xen-watchdog @@ -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 --git a/tools/hotplug/NetBSD/Makefile b/tools/hotplug/NetBSD/Makefile index cd68304751..98c1c5bbd4 100644 --- a/tools/hotplug/NetBSD/Makefile +++ b/tools/hotplug/NetBSD/Makefile @@ -8,7 +8,7 @@ XEN_SCRIPTS += vif-bridge XEN_SCRIPTS += vif-ip XEN_SCRIPT_DATA = -XEN_RCD_PROG = rc.d/xencommons rc.d/xend rc.d/xendomains +XEN_RCD_PROG = rc.d/xencommons rc.d/xend rc.d/xendomains rc.d/xen-watchdog .PHONY: all all: diff --git a/tools/hotplug/NetBSD/rc.d/xen-watchdog b/tools/hotplug/NetBSD/rc.d/xen-watchdog new file mode 100644 index 0000000000..ff4a52c134 --- /dev/null +++ b/tools/hotplug/NetBSD/rc.d/xen-watchdog @@ -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" diff --git a/tools/misc/Makefile b/tools/misc/Makefile index f8709562e2..843de9d3ec 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -41,10 +41,6 @@ install: build $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) $(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR) $(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 -endif set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done .PHONY: clean diff --git a/tools/misc/xen-watchdog b/tools/misc/xen-watchdog deleted file mode 100644 index 417b451922..0000000000 --- a/tools/misc/xen-watchdog +++ /dev/null @@ -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 -