From 6c822b07513496b5a7243331733f6fe570d79fa8 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 8 Oct 2007 01:12:50 -0400 Subject: [PATCH] remctl support for renaming machines svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=132 --- files/etc/remctl/conf.d/sipb-xen-web | 2 ++ files/usr/sbin/remctl-update.sh | 7 +++++++ files/usr/sbin/sipb-xen-lvrename | 8 ++++++++ 3 files changed, 17 insertions(+) create mode 100755 files/usr/sbin/sipb-xen-lvrename diff --git a/files/etc/remctl/conf.d/sipb-xen-web b/files/etc/remctl/conf.d/sipb-xen-web index b732ae6..8a984e4 100644 --- a/files/etc/remctl/conf.d/sipb-xen-web +++ b/files/etc/remctl/conf.d/sipb-xen-web @@ -1,7 +1,9 @@ web lvcreate /usr/sbin/sipb-xen-lvcreate /etc/remctl/acl/web web lvremove /usr/sbin/sipb-xen-lvremove /etc/remctl/acl/web +web lvrename /usr/sbin/sipb-xen-lvrename /etc/remctl/acl/web web vmboot /usr/sbin/sipb-xen-boot /etc/remctl/acl/web web register /usr/sbin/remctl-update.sh /etc/remctl/acl/web +web moveregister /usr/sbin/remctl-update.sh /etc/remctl/acl/web web unregister /usr/sbin/remctl-update.sh /etc/remctl/acl/web web remctl-moira-update /usr/sbin/remctl-update.sh /etc/remctl/acl/web web listvms /usr/sbin/sipb-xen-listvms /etc/remctl/acl/web diff --git a/files/usr/sbin/remctl-update.sh b/files/usr/sbin/remctl-update.sh index 79c860a..7b205bf 100755 --- a/files/usr/sbin/remctl-update.sh +++ b/files/usr/sbin/remctl-update.sh @@ -80,6 +80,13 @@ case "$1" in rm -f "$MACHINEDIR"/"$machine" "$0" web ;; + moveregister) + oldmachine="$2" + newmachine="$3" + mv "$ACLDIR"/"$oldmachine" "$ACLDIR"/"$newmachine" + rm -f "$MACHINEDIR"/"$oldmachine" + "$0" web + ;; register) machine="$2" if [ "$machine" == "Domain-0" ]; then diff --git a/files/usr/sbin/sipb-xen-lvrename b/files/usr/sbin/sipb-xen-lvrename new file mode 100755 index 0000000..8d46ee1 --- /dev/null +++ b/files/usr/sbin/sipb-xen-lvrename @@ -0,0 +1,8 @@ +#!/bin/sh +oldmachine="$2" +newmachine="$3" +disk="$4" + +if [ -e /etc/remctl/sipb-xen-auto/acl/"$oldmachine" ]; then + /sbin/lvrename xenvg "$oldmachine"_"$disk" "$newmachine"_"$disk" +fi -- 1.7.9.5