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

[Xen-devel] [PATCH v2 6/7] tools/xendomains: move to sbin and use init helper



From: "Luis R. Rodriguez" <mcgrof@xxxxxxxx>

The xendomains script can be resued with systemd systems as it
does not control services or sockets per se, but does a one shot
scrape of domUs it needs start bring up, stop, reload so we're
going to resue it.

Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Jan RÄkorajski <baggins@xxxxxxxxxxxxx>
Cc: M A Young <m.a.young@xxxxxxxxxxxx>
Cc: Jacek Konieczny <jajcus@xxxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxx>
---
 tools/hotplug/Linux/Makefile                |  4 +++-
 tools/hotplug/Linux/init.d/xendomains-init  | 33 +++++++++++++++++++++++++++++
 tools/hotplug/Linux/{init.d => }/xendomains |  0
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 tools/hotplug/Linux/init.d/xendomains-init
 rename tools/hotplug/Linux/{init.d => }/xendomains (100%)

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 47655f6..0be2e8a 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -3,7 +3,8 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 # Init scripts.
 XEND_INITD = init.d/xend
-XENDOMAINS_INITD = init.d/xendomains
+XENDOMAINS_INITD = init.d/xendomains-init
+XENDOMAINS_SBIN = xendomains
 XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
 
 XENCOMMONS_INITD = init.d/xencommons
@@ -50,6 +51,7 @@ install-initd:
 ifeq ($(CONFIG_XEND),y)
        $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
 endif
+       $(INSTALL_PROG) $(XENDOMAINS_SBIN) $(DESTDIR)$(SBINDIR)
        $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
        $(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) 
$(DESTDIR)$(SYSCONFIG_DIR)/xendomains
        $(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
diff --git a/tools/hotplug/Linux/init.d/xendomains-init 
b/tools/hotplug/Linux/init.d/xendomains-init
new file mode 100644
index 0000000..da55932
--- /dev/null
+++ b/tools/hotplug/Linux/init.d/xendomains-init
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# /etc/init.d/xendomains-init
+#
+# wrapper for starting / stopping domains automatically when domain
+# 0 boots / shuts down on systems using init. The $SBINDIR/xendomains
+# helper is shared between init and systemd systems.
+#
+
+. /etc/xen/scripts/hotplugpath.sh
+
+case "$1" in
+    start)
+       $SBINDIR/xendomains start
+       ;;
+    stop)
+       $SBINDIR/xendomains stop
+       ;;
+    restart)
+       $SBINDIR/xendomains restart
+       ;;
+    reload)
+       $SBINDIR/xendomains reload
+       ;;
+    status)
+       $SBINDIR/xendomains status
+       ;;
+    *)
+       echo "Usage: $0 {start|stop|restart|reload|status}"
+       exit 3
+       ;;
+esac
+exit $?
diff --git a/tools/hotplug/Linux/init.d/xendomains 
b/tools/hotplug/Linux/xendomains
similarity index 100%
rename from tools/hotplug/Linux/init.d/xendomains
rename to tools/hotplug/Linux/xendomains
-- 
1.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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