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

[Xen-API] [PATCH 22 of 33] interface-reconfigure: move /etc/init.d/management-interface to this repository



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


 


Rackspace

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