svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=121
+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.
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
include /etc/remctl/sipb-xen-auto/machine.d
-remctl-auto-update all /etc/remctl/sipb-xen-auto/remctl-update.sh ANYUSER
--- /dev/null
+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
+
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:
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.
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.
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:
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
# need them for this script.
ACTION=$(echo "$0" | awk -F'.' '{print $2}')
-MACHINE=$1
+MACHINE="$1"
echo "$ACTION"
case "$ACTION" in
xm "$ACTION" "$MACHINE"
exit 0
;;
+ list-long)
+ xm list --long "$MACHINE"
+ ;;
*)
echo "ERROR: Invalid Command"
exit 1
--- /dev/null
+dispatch.sh
\ No newline at end of file
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()
--- /dev/null
+#!/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