more support for web interface fixes
authorTim Abbott <tabbott@mit.edu>
Mon, 8 Oct 2007 02:21:39 +0000 (22:21 -0400)
committerTim Abbott <tabbott@mit.edu>
Mon, 8 Oct 2007 02:21:39 +0000 (22:21 -0400)
svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=130

files/etc/remctl/conf.d/sipb-xen-web
files/usr/sbin/remctl-update.sh

index e5f6bd0..b732ae6 100644 (file)
@@ -1,6 +1,7 @@
 web lvcreate /usr/sbin/sipb-xen-lvcreate /etc/remctl/acl/web
 web lvcreate /usr/sbin/sipb-xen-lvcreate /etc/remctl/acl/web
+web lvremove /usr/sbin/sipb-xen-lvremove /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 vmboot /usr/sbin/sipb-xen-boot /etc/remctl/acl/web
 web register /usr/sbin/remctl-update.sh /etc/remctl/acl/web
-web remctl-moira-update all /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
 web listvms /usr/sbin/sipb-xen-listvms /etc/remctl/acl/web
-web lvremove /usr/sbin/sipb-xen-lvremove /etc/remctl/acl/web
index 9b7f309..79c860a 100755 (executable)
@@ -74,27 +74,34 @@ case "$1" in
        # This extracts the list of all moira lists we care about, and updates those.
        grep -R moira "$ACLDIR/" /etc/remctl/acl/ | perl -pe 's/.*moira-acl\/(.*)/$1/g' >| "$AUTOMOIRALIST"
        ;;
        # This extracts the list of all moira lists we care about, and updates those.
        grep -R moira "$ACLDIR/" /etc/remctl/acl/ | perl -pe 's/.*moira-acl\/(.*)/$1/g' >| "$AUTOMOIRALIST"
        ;;
+    unregister)
+       machine="$2"
+       rm -f "$ACLDIR"/"$machine"
+       rm -f "$MACHINEDIR"/"$machine"
+       "$0" web
+       ;;
     register)
     register)
-       if [ "$2" == "Domain-0" ]; then
+       machine="$2"
+       if [ "$machine" == "Domain-0" ]; then
            echo "No, you can't control Domain 0"
            exit 1
        fi
            echo "No, you can't control Domain 0"
            exit 1
        fi
-       if [ -e /etc/xen/"$2" ]; then
+       if [ -e /etc/xen/"$machine" ]; then
            echo "Machine already exists outside database"
            exit 1
        fi
            echo "Machine already exists outside database"
            exit 1
        fi
-       if [ -e "$ACLDIR"/"$2" ]; then
+       if [ -e "$ACLDIR"/"$machine" ]; then
            echo "Machine already registered"
            exit 1
        fi
            echo "Machine already registered"
            exit 1
        fi
-       echo "include /etc/remctl/acl/web" > "$ACLDIR/$2"
+       echo "include /etc/remctl/acl/web" > "$ACLDIR/$machine"
        "$0" web
        ;;
     web)
        "$0" auto_machine_list
        "$0" all_machines
        ;;      
        "$0" web
        ;;
     web)
        "$0" auto_machine_list
        "$0" all_machines
        ;;      
-    all)
+    remctl-moira-update|all)
        "$0" auto_machine_list
        "$0" all_machines
        "$0" auto_moira_list
        "$0" auto_machine_list
        "$0" all_machines
        "$0" auto_moira_list