[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools: Add missing files under tools/hotplug/Linux/init.d



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1275927277 -3600
# Node ID de101fc39fc3cd20d950bc9e905b7ad1ce71260c
# Parent  3b64bf19ecc21cf0a8988ff444f785dd6d0fbe75
tools: Add missing files under tools/hotplug/Linux/init.d

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/hotplug/Linux/init.d/sysconfig.xencommons |   11 +++
 tools/hotplug/Linux/init.d/xencommons           |   87 ++++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff -r 3b64bf19ecc2 -r de101fc39fc3 
tools/hotplug/Linux/init.d/sysconfig.xencommons
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/hotplug/Linux/init.d/sysconfig.xencommons   Mon Jun 07 17:14:37 
2010 +0100
@@ -0,0 +1,11 @@
+# Log xenconsoled messages (cf xl dmesg)
+#XENCONSOLED_TRACE=[none|guest|hv|all]
+
+# Log xenstored messages
+#XENSTORED_TRACE=[yes|on|1]
+
+# Running xenstored on XENSTORED_ROOTDIR
+#XENSTORED_ROOTDIR=/var/lib/xenstored
+
+# Running xenbackendd in debug mode
+#XENBACKENDD_DEBUG=[yes|on|1]
diff -r 3b64bf19ecc2 -r de101fc39fc3 tools/hotplug/Linux/init.d/xencommons
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons     Mon Jun 07 17:14:37 2010 +0100
@@ -0,0 +1,87 @@
+#!/bin/bash
+#
+# xencommons    Script to start and stop xenstored and xenconsoled
+#
+# Author:       Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
+#
+# chkconfig: 2345
+# description: Starts and stops xenstored and xenconsoled
+### BEGIN INIT INFO
+# Provides:          xenstored xenconsoled
+# Required-Start:    $syslog $remote_fs
+# Should-Start:
+# Required-Stop:     $syslog $remote_fs
+# Should-Stop:
+# Default-Start:     3 4 5
+# Default-Stop:      1
+# Default-Enabled:   yes
+# Short-Description: Start/stop xenstored and xenconsoled
+# Description:       Starts and stops the daemons neeeded for xl/xend
+### END INIT INFO
+
+test -f /etc/sysconfig/xencommons && . /etc/sysconfig/xencommons
+
+XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid
+shopt -s extglob
+
+if test "x$1" = xstart && \
+     test -d /proc/xen && \
+   ! test -d /proc/xen/capabilities && \
+     grep '    xenfs$' /proc/filesystems >/dev/null && \
+   ! grep '^xenfs ' /proc/mounts >/dev/null;
+then
+       mount -t xenfs xenfs /proc/xen
+fi
+
+if ! grep -q "control_d" /proc/xen/capabilities ; then
+       exit 0
+fi
+
+do_start () {
+       if ! `xenstore-read -s / >/dev/null 2>&1`
+       then
+               test -z "$XENSTORED_ROOTDIR" || 
XENSTORED_ROOTDIR="/var/lib/xenstored"
+               rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
+               test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T 
/var/log/xen/xenstored-trace.log"
+               xenstored --pid-file=/var/run/xenstore.pid $XENSTORED_ARGS
+               xenstore-write "/local/domain/0/name" "Domain-0"
+       fi
+
+       test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" -T 
/var/log/xen/xenstored-trace.log"
+       xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS
+       test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d"
+       test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS
+}
+do_stop () {
+       if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then
+               kill $pid
+               while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done
+               rm -f $XENCONSOLED_PIDFILE
+       fi
+}
+
+case "$1" in
+  start)
+       do_start
+       ;;
+  status)
+        xenstore-read -s /
+       ;;
+  stop)
+       do_stop
+       ;;
+  reload)
+       echo >&2 'Reload not available; use force-reload'; exit 1
+       ;;
+  force-reload|restart)
+        do_stop
+       do_start
+       ;;
+  *)
+       # do not advertise unreasonable commands that there is no reason
+       # to use with this device
+       echo $"Usage: $0 {start|stop|status|restart|force-reload}"
+       exit 1
+esac
+
+exit $?

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.