WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 22 of 33] interface-reconfigure: move /etc/init.d/manag

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 22 of 33] interface-reconfigure: move /etc/init.d/management-interface to this repository
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Fri, 18 Dec 2009 14:17:17 +0000
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Fri, 18 Dec 2009 06:21:26 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1261145815@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
It logically belongs alongside interface-reconfigure.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r d51959c290a2 -r e74e2f09d0ee scripts/OMakefile
--- a/scripts/OMakefile Fri Dec 18 14:16:32 2009 +0000
+++ b/scripts/OMakefile Fri Dec 18 14:16:32 2009 +0000
@@ -31,6 +31,7 @@
        $(IPROG) init.d-xapissl $(DIST)/staging/etc/rc.d/init.d/xapissl
        $(IPROG) init.d-xapi-domains 
$(DIST)/staging/etc/rc.d/init.d/xapi-domains
        $(IPROG) init.d-squeezed $(DIST)/staging/etc/rc.d/init.d/squeezed
+       $(IPROG) init.d-management-interface 
$(DIST)/staging/etc/rc.d/init.d/management-interface
        $(IDATA) squeezed-logrotate $(DIST)/staging/etc/logrotate.d/squeezed
        $(IPROG) init.d-v6d $(DIST)/staging/etc/rc.d/init.d/v6d
        $(IDATA) v6d-logrotate $(DIST)/staging/etc/logrotate.d/v6d
diff -r d51959c290a2 -r e74e2f09d0ee scripts/init.d-management-interface
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/init.d-management-interface       Fri Dec 18 14:16:32 2009 +0000
@@ -0,0 +1,65 @@
+#!/bin/bash
+#
+# Bring up XenServer management interface
+#
+# chkconfig: 2345 13 76
+# description: Bring up XenServer management interface
+
+. /etc/init.d/functions
+
+export XENSOURCE_INVENTORY=/etc/xensource-inventory
+export INTERFACE_RECONFIGURE=/opt/xensource/libexec/interface-reconfigure
+
+[ -r ${XENSOURCE_INVENTORY} ] || exit 0
+. ${XENSOURCE_INVENTORY}
+
+bring_up_mgmt_if() {
+    [ -n "${MANAGEMENT_INTERFACE}" ] || return 0
+    action $"Bringing up management interface ${MANAGEMENT_INTERFACE}: " \
+       ${INTERFACE_RECONFIGURE} --management --force-interface 
${MANAGEMENT_INTERFACE} up
+    touch /var/lock/subsys/management-interface
+}
+
+bring_up_current_ifs(){
+    [ -n "${CURRENT_INTERFACES}" ] || return 0
+    for INTF in ${CURRENT_INTERFACES}; do
+        [ ${INTF} != ${MANAGEMENT_INTERFACE} ] || continue
+       action $"Bringing up additional interface ${INTF}: " \
+           ${INTERFACE_RECONFIGURE} --force-interface ${INTF} up
+    done
+}
+
+start() {
+    bring_up_mgmt_if
+    bring_up_current_ifs
+}
+
+stop() {
+    [ -n "${INSTALLATION_UUID}" ] || return 0
+    echo -n 
+    rm -f /var/lock/subsys/management-interface
+    PIF=$(xe pif-list host-uuid="${INSTALLATION_UUID}" management=true 
--minimal)
+    [ -n "${PIF}" ] || return 0
+    action $"Storing management interface configuration: " \
+       ${INTERFACE_RECONFIGURE} --pif-uuid "${PIF}" --management 
rewrite-configuration
+}
+
+restart() {
+    stop
+    start
+}
+
+case "$1" in
+    start)
+        start
+        ;;
+    stop)
+        stop
+        ;;
+    restart)
+        restart
+        ;;
+    *)
+        echo "Unknown action '$1'."
+        ;;
+esac

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>