From: Christoph Egger Subject: [PATCH] tools: xen-watchdog init script Date: Wed, 9 Jun 2010 13:57:29 +0200 Message-ID: <201006091357.30193.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_qG4DMw4tNHpq2LT" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_qG4DMw4tNHpq2LT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi! Attached patch renames xen-watchdog init script to xen-watchdog-linux. Add xen-watchdog-netbsd init script. Install them as xen-watchdog depending on the underlying OS. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --Boundary-00=_qG4DMw4tNHpq2LT Content-Type: text/x-diff; charset="iso 8859-15"; name="xen_tools_watchdog.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_tools_watchdog.diff" 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" --Boundary-00=_qG4DMw4tNHpq2LT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_qG4DMw4tNHpq2LT--