Move things around and add web interface support code.
authorTim Abbott <tabbott@mit.edu>
Sun, 7 Oct 2007 21:46:55 +0000 (17:46 -0400)
committerTim Abbott <tabbott@mit.edu>
Sun, 7 Oct 2007 21:46:55 +0000 (17:46 -0400)
svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=121

16 files changed:
debian/changelog
files/etc/cron.d/sipb-xen-remctl-auto
files/etc/remctl/conf.d/sipb-xen-auto
files/etc/remctl/conf.d/sipb-xen-web [new file with mode: 0644]
files/etc/remctl/sipb-xen-auto/README
files/etc/remctl/sipb-xen-auto/conf.template
files/usr/sbin/dispatch.create.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.create.sh with 100% similarity]
files/usr/sbin/dispatch.destroy.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.destroy.sh with 100% similarity]
files/usr/sbin/dispatch.list-long.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.list.sh with 100% similarity]
files/usr/sbin/dispatch.list.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.reboot.sh with 100% similarity]
files/usr/sbin/dispatch.reboot.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.uptime.sh with 100% similarity]
files/usr/sbin/dispatch.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.sh with 90% similarity]
files/usr/sbin/dispatch.uptime.sh [moved from files/etc/remctl/sipb-xen-auto/bin/dispatch.vcpu-list.sh with 100% similarity]
files/usr/sbin/dispatch.vcpu-list.sh [new symlink]
files/usr/sbin/remctl-update.sh [moved from files/etc/remctl/sipb-xen-auto/remctl-update.sh with 99% similarity]
files/usr/sbin/sipb-xen-boot [new file with mode: 0755]

index 5a0be9d..8a351ea 100644 (file)
@@ -1,3 +1,11 @@
+sipb-xen-remctl-auto (1.0.2) unstable; urgency=low
+
+  * Added web interface support code.
+  * Move things from /etc/remctl/sipb-xen-auto/bin to /usr/sbin
+  * Quoted lots of variables
+
+ -- Tim Abbott <tabbott@sipb-xen-dev.mit.edu>  Sun,  7 Oct 2007 17:23:40 -0400
+
 sipb-xen-remctl-auto (1.0.1) unstable; urgency=low
 
   * Stop scaring me with unquoted variables.
index f29e9a6..78cc8a4 100644 (file)
@@ -2,8 +2,9 @@
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 MAILTO=root
+UPDATE=/usr/sbin/remctl-update.sh
 
-@reboot         root    if [ -x /etc/remctl/sipb-xen-auto/remctl-update.sh ]; then nice -n10 /etc/remctl/sipb-xen-auto/remctl-update.sh all; fi
-* * * * */15       root    if [ -x /etc/remctl/sipb-xen-auto/remctl-update.sh ]; then nice -n10 /etc/remctl/sipb-xen-auto/remctl-update.sh all; fi
+@reboot         root    if [ -x "$UPDATE" ]; then nice -n10 "$UPDATE" all; fi
+* * * * */15       root    if [ -x "$UPDATE" ]; then nice -n10 "$UPDATE" all; fi
 
 # EOF
index 017d322..45e6580 100644 (file)
@@ -1,2 +1 @@
 include /etc/remctl/sipb-xen-auto/machine.d
-remctl-auto-update all /etc/remctl/sipb-xen-auto/remctl-update.sh ANYUSER
diff --git a/files/etc/remctl/conf.d/sipb-xen-web b/files/etc/remctl/conf.d/sipb-xen-web
new file mode 100644 (file)
index 0000000..179c4ff
--- /dev/null
@@ -0,0 +1,5 @@
+web lvcreate /usr/sbin/sipb-xen-lvcreate /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
+
index 0a4aa84..86ced5d 100644 (file)
@@ -1,7 +1,7 @@
 This is Tim Abbott's initial draft at our automatic remctl
 configuration.
 
-/etc/remctl/sipb-xen-auto/remctl-update.sh is the magic script.  Run
+/usr/sbin/remctl-update.sh is the magic script.  Run
 it with "all" as an argument, and it will update everything.
 
 The inputs to this system are as follows:
@@ -18,7 +18,7 @@ to include AFS groups in ACLs.  To add a new machine to the system,
 you simply need to create /etc/remctl/sipb-xen-auto/acl/MACHINENAME
 and then run
 
-/etc/remctl/sipb-xen-auto/remctl-update.sh all
+/usr/sbin/remctl-update.sh all
 
 Everything else is autogenerated from that information.
 
@@ -41,12 +41,12 @@ is generated by parsing the ACL files in /etc/remctl/sipb-xen-auto/acl/.
 
 This package also includes a crontab to run
 
-/etc/remctl/sipb-xen-auto/remctl-update.sh all
+/usr/sbin/remctl-update.sh all
 
 every 15 minutes or so to keep our Moira mapping up to date.  One can
 request an update of our Moira mapping for group X by running
 
-/etc/remctl/sipb-xen-auto/remctl-update.sh moiragroup X
+/usr/sbin/remctl-update.sh moiragroup X
 
 The web interface should probably run this when it adds a group.  We
 may want to make this also available to users, but I've been lame.
@@ -54,7 +54,7 @@ may want to make this also available to users, but I've been lame.
 This package includes a remctl interface available to anyone to invoke
 the command:
 
-/etc/remctl/sipb-xen-auto/remctl-update.sh all
+/usr/sbin/remctl-update.sh all
 
 using the following command from your favorite machine with remctl:
 
index ab45969..b066a7d 100644 (file)
@@ -2,5 +2,7 @@ create #MACHINENAME# #BINDIR#/dispatch.create.sh /etc/remctl/sipb-xen-auto/acl/#
 reboot #MACHINENAME# #BINDIR#/dispatch.reboot.sh /etc/remctl/sipb-xen-auto/acl/#MACHINENAME#
 destroy #MACHINENAME# #BINDIR#/dispatch.destroy.sh /etc/remctl/sipb-xen-auto/acl/#MACHINENAME#
 list #MACHINENAME# #BINDIR#/dispatch.list.sh /etc/remctl/sipb-xen-auto/acl/#MACHINENAME#
+list-long #MACHINENAME# #BINDIR#/dispatch.list-long.sh /etc/remctl/sipb-xen-auto/acl/#MACHINENAME#
 vcpu-list #MACHINENAME# #BINDIR#/dispatch.vcpu-list.sh /etc/remctl/sipb-xen-auto/acl/#MACHINENAME#
 uptime #MACHINENAME# #BINDIR#/dispatch.uptime.sh /etc/remctl/sipb-xen-auto/acl/#MACHINENAME#
+vnc_get_port_auth #MACHINENAME# #BINDIR#/get_port /etc/remctl/acl/vnc
similarity index 90%
rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.sh
rename to files/usr/sbin/dispatch.sh
index dfc8bd0..31723a3 100755 (executable)
@@ -10,7 +10,7 @@
 # need them for this script.
 
 ACTION=$(echo "$0" | awk -F'.' '{print $2}')
-MACHINE=$1
+MACHINE="$1"
 echo "$ACTION"
 
 case "$ACTION" in
@@ -18,6 +18,9 @@ case "$ACTION" in
         xm "$ACTION" "$MACHINE"
         exit 0
        ;;
+    list-long)
+       xm list --long "$MACHINE"
+       ;;
     *)
         echo "ERROR: Invalid Command"
         exit 1
diff --git a/files/usr/sbin/dispatch.vcpu-list.sh b/files/usr/sbin/dispatch.vcpu-list.sh
new file mode 120000 (symlink)
index 0000000..29a39d7
--- /dev/null
@@ -0,0 +1 @@
+dispatch.sh
\ No newline at end of file
similarity index 99%
rename from files/etc/remctl/sipb-xen-auto/remctl-update.sh
rename to files/usr/sbin/remctl-update.sh
index 3999144..4427531 100755 (executable)
@@ -7,7 +7,7 @@ MOIRATMP=$DIR/moira-tmp
 MACHINETMP=$DIR/machine-list-tmp
 AUTOMACHINELIST=$DIR/auto-machine-list
 AUTOMOIRALIST=$DIR/auto-moira-list
-BINDIR=$DIR/bin
+BINDIR=/usr/sbin
 ACLDIR=$DIR/acl
 
 update_machine()
diff --git a/files/usr/sbin/sipb-xen-boot b/files/usr/sbin/sipb-xen-boot
new file mode 100755 (executable)
index 0000000..ff0241d
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+machine=$2
+cdrom=$3
+
+if [ -n "$cdrom" ]; then
+        xm create sipb-database machine_id="$machine" cdrom_image="$cdrom"
+else
+        xm create sipb-database machine_id="$machine"
+fi