From: Tim Abbott Date: Sun, 7 Oct 2007 21:46:55 +0000 (-0400) Subject: Move things around and add web interface support code. X-Git-Tag: sipb-xen-remctl-auto/1.0.4~18 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/commitdiff_plain/480a3aa5aac82bf10b898e37761414518774a939 Move things around and add web interface support code. svn path=/trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/; revision=121 --- diff --git a/debian/changelog b/debian/changelog index 5a0be9d..8a351ea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Sun, 7 Oct 2007 17:23:40 -0400 + sipb-xen-remctl-auto (1.0.1) unstable; urgency=low * Stop scaring me with unquoted variables. diff --git a/files/etc/cron.d/sipb-xen-remctl-auto b/files/etc/cron.d/sipb-xen-remctl-auto index f29e9a6..78cc8a4 100644 --- a/files/etc/cron.d/sipb-xen-remctl-auto +++ b/files/etc/cron.d/sipb-xen-remctl-auto @@ -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 diff --git a/files/etc/remctl/conf.d/sipb-xen-auto b/files/etc/remctl/conf.d/sipb-xen-auto index 017d322..45e6580 100644 --- a/files/etc/remctl/conf.d/sipb-xen-auto +++ b/files/etc/remctl/conf.d/sipb-xen-auto @@ -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 index 0000000..179c4ff --- /dev/null +++ b/files/etc/remctl/conf.d/sipb-xen-web @@ -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 + diff --git a/files/etc/remctl/sipb-xen-auto/README b/files/etc/remctl/sipb-xen-auto/README index 0a4aa84..86ced5d 100644 --- a/files/etc/remctl/sipb-xen-auto/README +++ b/files/etc/remctl/sipb-xen-auto/README @@ -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: diff --git a/files/etc/remctl/sipb-xen-auto/conf.template b/files/etc/remctl/sipb-xen-auto/conf.template index ab45969..b066a7d 100644 --- a/files/etc/remctl/sipb-xen-auto/conf.template +++ b/files/etc/remctl/sipb-xen-auto/conf.template @@ -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 diff --git a/files/etc/remctl/sipb-xen-auto/bin/dispatch.create.sh b/files/usr/sbin/dispatch.create.sh similarity index 100% rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.create.sh rename to files/usr/sbin/dispatch.create.sh diff --git a/files/etc/remctl/sipb-xen-auto/bin/dispatch.destroy.sh b/files/usr/sbin/dispatch.destroy.sh similarity index 100% rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.destroy.sh rename to files/usr/sbin/dispatch.destroy.sh diff --git a/files/etc/remctl/sipb-xen-auto/bin/dispatch.list.sh b/files/usr/sbin/dispatch.list-long.sh similarity index 100% rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.list.sh rename to files/usr/sbin/dispatch.list-long.sh diff --git a/files/etc/remctl/sipb-xen-auto/bin/dispatch.reboot.sh b/files/usr/sbin/dispatch.list.sh similarity index 100% rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.reboot.sh rename to files/usr/sbin/dispatch.list.sh diff --git a/files/etc/remctl/sipb-xen-auto/bin/dispatch.uptime.sh b/files/usr/sbin/dispatch.reboot.sh similarity index 100% rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.uptime.sh rename to files/usr/sbin/dispatch.reboot.sh diff --git a/files/etc/remctl/sipb-xen-auto/bin/dispatch.sh b/files/usr/sbin/dispatch.sh 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 --- a/files/etc/remctl/sipb-xen-auto/bin/dispatch.sh +++ b/files/usr/sbin/dispatch.sh @@ -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/etc/remctl/sipb-xen-auto/bin/dispatch.vcpu-list.sh b/files/usr/sbin/dispatch.uptime.sh similarity index 100% rename from files/etc/remctl/sipb-xen-auto/bin/dispatch.vcpu-list.sh rename to files/usr/sbin/dispatch.uptime.sh diff --git a/files/usr/sbin/dispatch.vcpu-list.sh b/files/usr/sbin/dispatch.vcpu-list.sh new file mode 120000 index 0000000..29a39d7 --- /dev/null +++ b/files/usr/sbin/dispatch.vcpu-list.sh @@ -0,0 +1 @@ +dispatch.sh \ No newline at end of file diff --git a/files/etc/remctl/sipb-xen-auto/remctl-update.sh b/files/usr/sbin/remctl-update.sh 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 --- a/files/etc/remctl/sipb-xen-auto/remctl-update.sh +++ b/files/usr/sbin/remctl-update.sh @@ -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 index 0000000..ff0241d --- /dev/null +++ b/files/usr/sbin/sipb-xen-boot @@ -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