From: Greg Price Date: Sun, 11 May 2008 01:19:12 +0000 (-0400) Subject: remove {,un,move}register commands in remote server X-Git-Tag: sipb-xen-remote-server/0.2~28 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-remote.git/commitdiff_plain/f3ef8542edbffe76e44b3c13b431ca83588cfe2c?hp=14f703fe8a131cfe17a2037af6abe88f85d06938 remove {,un,move}register commands in remote server svn path=/trunk/packages/sipb-xen-remote-server/; revision=523 --- diff --git a/debian/changelog b/debian/changelog index 0f90824..e735d1c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ sipb-xen-remote-server (0.2) unstable; urgency=low * FUSE filesystem for remctl configuration. + * Remove *register calls, since the FUSE keeps things up to date. - -- Greg Price Sat, 10 May 2008 20:50:49 -0400 + -- Greg Price Sat, 10 May 2008 21:08:58 -0400 sipb-xen-remote-server (0.1) unstable; urgency=low diff --git a/files/etc/remctl/conf.d/sipb-xen-web b/files/etc/remctl/conf.d/sipb-xen-web index 20055fb..f79ebbf 100644 --- a/files/etc/remctl/conf.d/sipb-xen-web +++ b/files/etc/remctl/conf.d/sipb-xen-web @@ -4,8 +4,4 @@ web lvrename /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web web lvresize /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web web lvcopy /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web web vmboot /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web -web register /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web -web moveregister /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web -web unregister /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web -web remctl-moira-update /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web web listvms /usr/sbin/sipb-xen-remote-proxy-web /etc/remctl/acl/web diff --git a/files/usr/sbin/sipb-xen-remctl-update b/files/usr/sbin/sipb-xen-remctl-update deleted file mode 100755 index f0254b9..0000000 --- a/files/usr/sbin/sipb-xen-remctl-update +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/sh -DIR=/etc/remctl/sipb-xen-auto -TEMPLATE=$DIR/conf.template -MACHINEDIR=$DIR/machine.d -MOIRADIR=$DIR/moira-acl -MOIRATMP=$DIR/moira-tmp -MACHINETMP=$DIR/machine-list-tmp -AUTOMACHINELIST=$DIR/auto-machine-list -AUTOMOIRALIST=$DIR/auto-moira-list -BINDIR=/usr/sbin -ACLDIR=$DIR/acl - -update_machine() -{ - machine="$1" - sed "s/#MACHINENAME#/$machine/g" "$TEMPLATE" | \ - sed "s,#BINDIR#,$BINDIR,g" >| "$MACHINETMP" - if ! cmp -s "$MACHINEDIR/$machine" "$MACHINETMP"; then - mv "$MACHINETMP" "$MACHINEDIR/$machine" - else - rm -f "$MACHINETMP" - fi -} - -update_moiragroup() -{ - group="$1" - # Should perhaps replace with LDAP, but fine for now. - - # We should do more careful error checking so we don't take away - # all bits and delete the moira-acl files whenever there's an AFS - # outage. - pts membership system:"$group" -noauth | tail -n+2 | \ - sed 's/\./\//' | \ - sed 's/^ //' | \ - sed 's/$/@ATHENA.MIT.EDU/g' >| "$MOIRATMP" - if test -s "$MOIRATMP"; then - if ! cmp -s "$MOIRADIR/$group" "$MOIRATMP"; then - mv "$MOIRATMP" "$MOIRADIR/$group" - fi - else - if test -e "$MOIRADIR/$group"; then - rm "$MOIRADIR/$group" - fi - fi - rm -f "$MOIRATMP" -} - -check_machine_name() -{ - machinename="$1" - if ! perl -0e 'exit($ARGV[0] !~ /^[A-Za-z0-9][A-Za-z0-9._-]*$/)' -- "$machinename"; then - echo "Bad machine name" - exit 1 - fi -} - -case "$1" in - moiragroup) - update_moiragroup "$2" - ;; - - all_machines) - # update the remctl.conf definitions - for machine in `cat "$AUTOMACHINELIST"`; do - update_machine "$machine" - done - ;; - all_moira) - # update our moira ACL lists - for group in `cat "$AUTOMOIRALIST"`; do - update_moiragroup "$group" - done - ;; - auto_machine_list) - # update the list of maintained machines - /bin/ls "$ACLDIR" >| "$AUTOMACHINELIST" - ;; - auto_moira_list) - # update the moira list-of-lists - # /bin/ls "$MOIRADIR" >| "$AUTOMOIRALIST" # BAD IDEA in case of outage - - # 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" - check_machine_name "$machine" - rm -f "$ACLDIR"/"$machine" - rm -f "$MACHINEDIR"/"$machine" - "$0" web - ;; - moveregister) - oldmachine="$2" - newmachine="$3" - check_machine_name "$oldmachine" - check_machine_name "$newmachine" - mv "$ACLDIR"/"$oldmachine" "$ACLDIR"/"$newmachine" - rm -f "$MACHINEDIR"/"$oldmachine" - "$0" web - ;; - register) - machine="$2" - check_machine_name "$machine" - if [ -e "$ACLDIR"/"$machine" ]; then - echo "Machine already registered" - exit 1 - fi - echo "include /etc/remctl/acl/web" > "$ACLDIR/$machine" - "$0" web - ;; - web) - "$0" auto_machine_list - "$0" all_machines - ;; - remctl-moira-update|all) - "$0" auto_machine_list - "$0" all_machines - "$0" auto_moira_list - "$0" all_moira - ;; -esac - -exit 0