Index: trunk/packages/sipb-xen-console/debian/changelog
===================================================================
--- trunk/packages/sipb-xen-console/debian/changelog	(revision 1198)
+++ trunk/packages/sipb-xen-console/debian/changelog	(revision 1200)
@@ -1,2 +1,9 @@
+invirt-console-server (0.0.1) unstable; urgency=low
+
+  * sipb-xen -> invirt
+  *  -> -server while we're at it
+
+ -- Greg Price <price@mit.edu>  Fri, 24 Oct 2008 03:54:40 -0400
+
 sipb-xen-console (8.4) unstable; urgency=low
 
Index: trunk/packages/sipb-xen-console/debian/control
===================================================================
--- trunk/packages/sipb-xen-console/debian/control	(revision 1198)
+++ trunk/packages/sipb-xen-console/debian/control	(revision 1200)
@@ -1,15 +1,14 @@
-Source: sipb-xen-console
+Source: invirt-console-server
 Section: servers
 Priority: extra
-Maintainer: SIPB Xen Project <sipb-xen@mit.edu>
+Maintainer: Invirt Project <invirt@mit.edu>
 Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), config-package-dev (>= 4.5~), nscd, openssh-server, debathena-ssh-server-config, initscripts
 Standards-Version: 3.7.2
 
-Package: sipb-xen-console
+Package: invirt-console-server
 Architecture: all
 Provides: ${diverted-files}
 Conflicts: ${diverted-files}
 Depends: sipb-xen-base, ${shlibs:Depends}, ${misc:Depends}, conserver-client, daemon, debathena-kerberos-config, fuse-utils, libnss-pgsql1, nscd, openssh-server, python, python-routefs, sipb-xen-chrony-config, sipb-xen-database-common, remctl-server, debathena-ssh-server-config
-Description: SIPB Xen serial console server
- This package  should be installed on sipb-xen-console
- It makes sure that necessary tools are available.
+Description: Invirt serial-console proxy server
+ This is the software for the serial-console proxy server.
Index: trunk/packages/sipb-xen-console/debian/copyright
===================================================================
--- trunk/packages/sipb-xen-console/debian/copyright	(revision 1198)
+++ trunk/packages/sipb-xen-console/debian/copyright	(revision 1200)
@@ -1,3 +1,3 @@
 This package was created for internal use of the SIPB Xen Project of
-the MIT Student Information Processing Board.  Ask sipb-xen@mit.edu if
+the MIT Student Information Processing Board.  Ask invirt@mit.edu if
 you have questions about redistribution.
Index: trunk/packages/sipb-xen-console/debian/invirt-console-server.init
===================================================================
--- trunk/packages/sipb-xen-console/debian/invirt-console-server.init	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/invirt-console-server.init	(revision 1200)
@@ -0,0 +1,135 @@
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides:          invirt-console-server
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Invirt console proxy server
+# Description:       
+### END INIT INFO
+
+# Author: Invirt Project <invirt@mit.edu>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="the Invirt console server"
+NAME=invirt-console-server
+DAEMON=/usr/bin/invirt-consolefs
+DAEMON_ARGS="/consolefs"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+gen_config()
+{
+    for i in /etc/conserver/invirt-hosts.cf \
+             /etc/remctl/acl/invirt-console-server \
+             /etc/issue.net.no_tkt \
+             /etc/nss-pgsql.conf \
+             ; do
+        mako-render $i.mako > $i
+    done
+}
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+	# Return
+	#   0 if daemon has been started
+	#   1 if daemon was already running
+	#   2 if daemon could not be started
+	modprobe fuse
+	gen_config
+	daemon --running -n $NAME && return 1
+	daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+	# Return
+	#   0 if daemon has been stopped
+	#   1 if daemon was already stopped
+	#   2 if daemon could not be stopped
+	#   other if a failure occurred
+	daemon --stop -n $NAME
+	RETVAL="$?"
+	[ "$RETVAL" = 2 ] && return 2
+	# Many daemons don't delete their pidfiles when they exit.
+	rm -f $PIDFILE
+	umount "$DAEMON_ARGS"
+	return "$RETVAL"
+}
+
+do_reload()
+{
+	gen_config
+	/etc/init.d/conserver-server reload
+}
+
+case "$1" in
+  start)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+	do_start
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  stop)
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+	do_stop
+	case "$?" in
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+	esac
+	;;
+  reload|force-reload)
+	log_daemon_msg "Reloading $DESC" "$NAME"
+	do_reload
+	log_end_msg $?
+	;;
+  restart)
+	log_daemon_msg "Restarting $DESC" "$NAME"
+	do_stop
+	case "$?" in
+	  0|1)
+		do_start
+		case "$?" in
+			0) log_end_msg 0 ;;
+			1) log_end_msg 1 ;; # Old process is still running
+			*) log_end_msg 1 ;; # Failed to start
+		esac
+		;;
+	  *)
+	  	# Failed to stop
+		log_end_msg 1
+		;;
+	esac
+	;;
+  *)
+	echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+	exit 3
+	;;
+esac
+
+:
Index: trunk/packages/sipb-xen-console/debian/invirt-console-server.install
===================================================================
--- trunk/packages/sipb-xen-console/debian/invirt-console-server.install	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/invirt-console-server.install	(revision 1200)
@@ -0,0 +1,1 @@
+files/* .
Index: trunk/packages/sipb-xen-console/debian/rules
===================================================================
--- trunk/packages/sipb-xen-console/debian/rules	(revision 1198)
+++ trunk/packages/sipb-xen-console/debian/rules	(revision 1200)
@@ -1,20 +1,20 @@
 #!/usr/bin/make -f
 
-DEB_DIVERT_EXTENSION = .sipb-xen
-DEB_TRANSFORM_FILES_sipb-xen-console += \
-	/etc/init.d/bootmisc.sh.sipb-xen \
-	/etc/nsswitch.conf.sipb-xen \
-	/etc/nscd.conf.sipb-xen \
-	/etc/pam.d/sshd.sipb-xen \
-	/etc/ssh/sshd_config.debathena.sipb-xen
+DEB_DIVERT_EXTENSION = .invirt
+DEB_TRANSFORM_FILES_invirt-console-server += \
+	/etc/init.d/bootmisc.sh.invirt \
+	/etc/nsswitch.conf.invirt \
+	/etc/nscd.conf.invirt \
+	/etc/pam.d/sshd.invirt \
+	/etc/ssh/sshd_config.debathena.invirt
 
 ifneq ($(wildcard /usr/share/base-files/nsswitch.conf),)
-    DEB_CHECK_FILES_SOURCE_/etc/nsswitch.conf.sipb-xen = \
+    DEB_CHECK_FILES_SOURCE_/etc/nsswitch.conf.invirt = \
         /usr/share/base-files/nsswitch.conf
 endif
 
-DEB_DIVERT_FILES_sipb-xen-console += \
-	/etc/conserver/conserver.cf.sipb-xen \
-	/etc/motd.sipb-xen
+DEB_DIVERT_FILES_invirt-console-server += \
+	/etc/conserver/conserver.cf.invirt \
+	/etc/motd.invirt
 
 include /usr/share/cdbs/1/rules/debhelper.mk
Index: trunk/packages/sipb-xen-console/debian/sipb-xen-console.init
===================================================================
--- trunk/packages/sipb-xen-console/debian/sipb-xen-console.init	(revision 1198)
+++ 	(revision )
@@ -1,135 +1,0 @@
-#!/bin/bash
-### BEGIN INIT INFO
-# Provides:          sipb-xen-console
-# Required-Start:    $local_fs $remote_fs
-# Required-Stop:     $local_fs $remote_fs
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: sipb-xen Console Server homedir filesystem
-# Description:       
-### END INIT INFO
-
-# Author: SIPB Xen Project <sipb-xen@mit.edu>
-
-# Do NOT "set -e"
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="The sipb-xen console server"
-NAME=sipb-xen-console
-DAEMON=/usr/bin/sipb-xen-consolefs
-DAEMON_ARGS="/consolefs"
-PIDFILE=/var/run/$NAME.pid
-SCRIPTNAME=/etc/init.d/$NAME
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-gen_config()
-{
-    for i in /etc/conserver/invirt-hosts.cf \
-             /etc/remctl/acl/invirt-console \
-             /etc/issue.net.no_tkt \
-             /etc/nss-pgsql.conf \
-             ; do
-        mako-render $i.mako > $i
-    done
-}
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
-	# Return
-	#   0 if daemon has been started
-	#   1 if daemon was already running
-	#   2 if daemon could not be started
-	modprobe fuse
-	gen_config
-	daemon --running -n $NAME && return 1
-	daemon -r -O daemon.info -E daemon.err -n $NAME -U $DAEMON $DAEMON_ARGS || return 2
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
-	# Return
-	#   0 if daemon has been stopped
-	#   1 if daemon was already stopped
-	#   2 if daemon could not be stopped
-	#   other if a failure occurred
-	daemon --stop -n $NAME
-	RETVAL="$?"
-	[ "$RETVAL" = 2 ] && return 2
-	# Many daemons don't delete their pidfiles when they exit.
-	rm -f $PIDFILE
-	umount "$DAEMON_ARGS"
-	return "$RETVAL"
-}
-
-do_reload()
-{
-	gen_config
-	/etc/init.d/conserver-server reload
-}
-
-case "$1" in
-  start)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-	do_start
-	case "$?" in
-		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-	esac
-	;;
-  stop)
-	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
-	do_stop
-	case "$?" in
-		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
-		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
-	esac
-	;;
-  reload|force-reload)
-	log_daemon_msg "Reloading $DESC" "$NAME"
-	do_reload
-	log_end_msg $?
-	;;
-  restart)
-	log_daemon_msg "Restarting $DESC" "$NAME"
-	do_stop
-	case "$?" in
-	  0|1)
-		do_start
-		case "$?" in
-			0) log_end_msg 0 ;;
-			1) log_end_msg 1 ;; # Old process is still running
-			*) log_end_msg 1 ;; # Failed to start
-		esac
-		;;
-	  *)
-	  	# Failed to stop
-		log_end_msg 1
-		;;
-	esac
-	;;
-  *)
-	echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
-	exit 3
-	;;
-esac
-
-:
Index: trunk/packages/sipb-xen-console/debian/sipb-xen-console.install
===================================================================
--- trunk/packages/sipb-xen-console/debian/sipb-xen-console.install	(revision 1198)
+++ 	(revision )
@@ -1,1 +1,0 @@
-files/* .
Index: trunk/packages/sipb-xen-console/debian/transform_bootmisc.sh.invirt
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_bootmisc.sh.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/transform_bootmisc.sh.invirt	(revision 1200)
@@ -0,0 +1,14 @@
+#!/bin/bash
+patch -p0 -o /dev/fd/4 3<&0 4>&1 1>/dev/null <<EOF
+
+# Yes, I there's no context. But the lines being replaced are less
+# likely to change than the lines around them
+
+--- Ignored
++++ /dev/fd/3
+@@ -42,3 +42,2 @@
+-	# Update motd
+-	uname -snrvm > /var/run/motd
+-	[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
++	# Do not update motd
++	cp /etc/motd /var/run/motd
Index: trunk/packages/sipb-xen-console/debian/transform_bootmisc.sh.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_bootmisc.sh.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#!/bin/bash
-patch -p0 -o /dev/fd/4 3<&0 4>&1 1>/dev/null <<EOF
-
-# Yes, I there's no context. But the lines being replaced are less
-# likely to change than the lines around them
-
---- Ignored
-+++ /dev/fd/3
-@@ -42,3 +42,2 @@
--	# Update motd
--	uname -snrvm > /var/run/motd
--	[ -f /etc/motd.tail ] && cat /etc/motd.tail >> /var/run/motd
-+	# Do not update motd
-+	cp /etc/motd /var/run/motd
Index: trunk/packages/sipb-xen-console/debian/transform_nscd.conf.invirt
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_nscd.conf.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/transform_nscd.conf.invirt	(revision 1200)
@@ -0,0 +1,6 @@
+#!/usr/bin/perl -0p
+s/^(\s*negative-time-to-live\s*passwd\s*).*$/${1}3/m or die;
+s/^(\s*negative-time-to-live\s*group\s*).*$/${1}3/m or die;
+s/^(\s*persistent\s*passwd\s*).*$/\1no/m or die;
+s/^(\s*persistent\s*group\s*).*$/\1no/m or die;
+
Index: trunk/packages/sipb-xen-console/debian/transform_nscd.conf.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_nscd.conf.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,6 +1,0 @@
-#!/usr/bin/perl -0p
-s/^(\s*negative-time-to-live\s*passwd\s*).*$/${1}3/m or die;
-s/^(\s*negative-time-to-live\s*group\s*).*$/${1}3/m or die;
-s/^(\s*persistent\s*passwd\s*).*$/\1no/m or die;
-s/^(\s*persistent\s*group\s*).*$/\1no/m or die;
-
Index: trunk/packages/sipb-xen-console/debian/transform_nsswitch.conf.invirt
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_nsswitch.conf.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/transform_nsswitch.conf.invirt	(revision 1200)
@@ -0,0 +1,3 @@
+#!/usr/bin/perl -0p
+s/^(passwd: .*)$/$1 pgsql/m or die;
+s/^(group: .*)$/$1 pgsql/m or die;
Index: trunk/packages/sipb-xen-console/debian/transform_nsswitch.conf.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_nsswitch.conf.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,3 +1,0 @@
-#!/usr/bin/perl -0p
-s/^(passwd: .*)$/$1 pgsql/m or die;
-s/^(group: .*)$/$1 pgsql/m or die;
Index: trunk/packages/sipb-xen-console/debian/transform_sshd.invirt
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_sshd.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/transform_sshd.invirt	(revision 1200)
@@ -0,0 +1,11 @@
+#!/bin/sh
+echo "# If they're not root, but their user exists (success),"
+echo 'auth    [success=ignore ignore=ignore default=1 module_unknown=die]   pam_succeed_if.so uid > 0'
+echo "# print the \"You don\'t have tickets\" error:"
+echo 'auth    [success=die ignore=reset default=die module_unknown=die]     pam_echo.so file=/etc/issue.net.no_tkt'
+echo "# If !(they are root),"
+echo 'auth    [success=1 ignore=ignore default=ignore module_unknown=die]   pam_succeed_if.so uid eq 0'
+echo "# print the \"your account doesn't exist\" error:"
+echo 'auth    [success=die ignore=reset default=die module_unknown=die]     pam_echo.so file=/etc/issue.net.no_user'
+echo
+exec cat
Index: trunk/packages/sipb-xen-console/debian/transform_sshd.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_sshd.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#!/bin/sh
-echo "# If they're not root, but their user exists (success),"
-echo 'auth    [success=ignore ignore=ignore default=1 module_unknown=die]   pam_succeed_if.so uid > 0'
-echo "# print the \"You don\'t have tickets\" error:"
-echo 'auth    [success=die ignore=reset default=die module_unknown=die]     pam_echo.so file=/etc/issue.net.no_tkt'
-echo "# If !(they are root),"
-echo 'auth    [success=1 ignore=ignore default=ignore module_unknown=die]   pam_succeed_if.so uid eq 0'
-echo "# print the \"your account doesn't exist\" error:"
-echo 'auth    [success=die ignore=reset default=die module_unknown=die]     pam_echo.so file=/etc/issue.net.no_user'
-echo
-exec cat
Index: trunk/packages/sipb-xen-console/debian/transform_sshd_config.debathena.invirt
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_sshd_config.debathena.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/debian/transform_sshd_config.debathena.invirt	(revision 1200)
@@ -0,0 +1,2 @@
+#!/usr/bin/perl -0p
+s/^#?PrintLastLog .*$/PrintLastLog no/m or die;
Index: trunk/packages/sipb-xen-console/debian/transform_sshd_config.debathena.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/debian/transform_sshd_config.debathena.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,2 +1,0 @@
-#!/usr/bin/perl -0p
-s/^#?PrintLastLog .*$/PrintLastLog no/m or die;
Index: trunk/packages/sipb-xen-console/files/etc/conserver/conserver.cf.invirt
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/conserver/conserver.cf.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/files/etc/conserver/conserver.cf.invirt	(revision 1200)
@@ -0,0 +1,23 @@
+# default config for console
+config * {
+	sslrequired yes;
+}
+# If no consoles are defined, as is the case when the host first boots
+# up, conserver will quit. This keeps it running.
+#
+# Should someone create a VM called dummy-console, their VM will
+# shadow over this one
+console dummy-console {
+        master localhost;
+        type noop;
+}
+
+default * {
+        type exec;
+}
+access * {
+        trusted 127.0.0.1;
+        limited *;
+}
+
+#include /etc/conserver/invirt-hosts.cf
Index: trunk/packages/sipb-xen-console/files/etc/conserver/conserver.cf.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/conserver/conserver.cf.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,23 +1,0 @@
-# default config for console
-config * {
-	sslrequired yes;
-}
-# If no consoles are defined, as is the case when the host first boots
-# up, conserver will quit. This keeps it running.
-#
-# Should someone create a VM called dummy-console, their VM will
-# shadow over this one
-console dummy-console {
-        master localhost;
-        type noop;
-}
-
-default * {
-        type exec;
-}
-access * {
-        trusted 127.0.0.1;
-        limited *;
-}
-
-#include /etc/conserver/invirt-hosts.cf
Index: trunk/packages/sipb-xen-console/files/etc/motd.invirt
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/motd.invirt	(revision 1200)
+++ trunk/packages/sipb-xen-console/files/etc/motd.invirt	(revision 1200)
@@ -0,0 +1,3 @@
+
+Type Ctrl-e, then c, then . to escape from the console
+
Index: trunk/packages/sipb-xen-console/files/etc/motd.sipb-xen
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/motd.sipb-xen	(revision 1198)
+++ 	(revision )
@@ -1,3 +1,0 @@
-
-Type Ctrl-e, then c, then . to escape from the console
-
Index: trunk/packages/sipb-xen-console/files/etc/nss-pgsql.conf.mako
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/nss-pgsql.conf.mako	(revision 1198)
+++ trunk/packages/sipb-xen-console/files/etc/nss-pgsql.conf.mako	(revision 1200)
@@ -2,7 +2,7 @@
 connectionstring = host=${cfg.db.host} dbname=${cfg.db.dbname} user=${cfg.db.user} port=${cfg.db.port}
 
-getpwnam = SELECT name, NULL, name, '/consolefs/'|| name, '/usr/bin/sipb-xen-consolesh', machine_id + 1000, machine_id + 1000 FROM machines WHERE name = $1
-getpwuid = SELECT name, NULL, name, '/consolefs/'|| name, '/usr/bin/sipb-xen-consolesh', machine_id + 1000, machine_id + 1000 FROM machines WHERE machine_id + 1000 = $1
-allusers = SELECT name, NULL, name, '/consolefs/'|| name, '/usr/bin/sipb-xen-consolesh', machine_id + 1000, machine_id + 1000 FROM machines
+getpwnam = SELECT name, NULL, name, '/consolefs/'|| name, '/usr/bin/invirt-consolesh', machine_id + 1000, machine_id + 1000 FROM machines WHERE name = $1
+getpwuid = SELECT name, NULL, name, '/consolefs/'|| name, '/usr/bin/invirt-consolesh', machine_id + 1000, machine_id + 1000 FROM machines WHERE machine_id + 1000 = $1
+allusers = SELECT name, NULL, name, '/consolefs/'|| name, '/usr/bin/invirt-consolesh', machine_id + 1000, machine_id + 1000 FROM machines
 getgrnam = SELECT name, NULL, machine_id + 1000 FROM machines WHERE name = $1
 getgrgid = SELECT name, NULL, machine_id + 1000 FROM machines WHERE machine_id + 1000 = $1
Index: trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console-server.mako
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console-server.mako	(revision 1200)
+++ trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console-server.mako	(revision 1200)
@@ -0,0 +1,4 @@
+<% from invirt.config import structs as cfg %>\
+% for h in cfg.hosts:
+host/${h.hostname}@${cfg.authn[0].realm}
+% endfor
Index: trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console.mako
===================================================================
--- trunk/packages/sipb-xen-console/files/etc/remctl/acl/invirt-console.mako	(revision 1198)
+++ 	(revision )
@@ -1,4 +1,0 @@
-<% from invirt.config import structs as cfg %>\
-% for h in cfg.hosts:
-host/${h.hostname}@${cfg.authn[0].realm}
-% endfor
Index: trunk/packages/sipb-xen-console/files/usr/bin/invirt-consolefs
===================================================================
--- trunk/packages/sipb-xen-console/files/usr/bin/invirt-consolefs	(revision 1200)
+++ trunk/packages/sipb-xen-console/files/usr/bin/invirt-consolefs	(revision 1200)
@@ -0,0 +1,92 @@
+#!/usr/bin/python
+
+import routefs
+from routes import Mapper
+
+from syslog import *
+from time import time
+
+import os
+import errno
+
+from invirt.config import structs as config
+from invirt import database
+
+realpath = "/home/machines/"
+
+class ConsoleFS(routefs.RouteFS):
+	"""
+	ConsoleFS creates a series of subdirectories each mirroring the same real
+	directory, except for a single file - the .k5login - which is dynamically
+	generated for each subdirectory
+	"""
+	
+	def __init__(self, *args, **kw):
+		"""Initialize the filesystem and set it to allow_other access besides
+		the user who mounts the filesystem (i.e. root)
+		"""
+		super(ConsoleFS, self).__init__(*args, **kw)
+		self.lasttime = time()
+		self.fuse_args.add("allow_other", True)
+		
+		openlog('invirt-consolefs ', LOG_PID, LOG_DAEMON)
+		
+		syslog(LOG_DEBUG, 'Init complete.')
+
+	def make_map(self):
+		m = Mapper()
+		m.connect('', controller='getMachines')
+		m.connect(':machine', controller='getMirror')
+		m.connect(':machine/.k5login', controller='getK5login')
+		m.connect(':machine/*(path)', controller='getMirror')
+		return m
+	
+	def getMachines(self, **kw):
+		"""Get the list of VMs in the database, clearing the cache if it's 
+		older than 15 seconds"""
+		if time() - self.lasttime > 15:
+			self.lasttime = time()
+			database.clear_cache()
+		return [machine.name for machine in database.Machine.query()]
+	
+	def getMirror(self, machine, path='', **kw):
+		"""Translate the path into its realpath equivalent, and return that
+		"""
+		real = realpath + path
+		if os.path.isdir(real):
+			# The list is converted to a set so that we can handle the case 
+			# where there is already a .k5login in the realpath gracefully	  
+			return routefs.Directory(set(os.listdir(real) + ['.k5login']))
+		elif os.path.islink(real):
+			return routefs.Symlink(os.readlink(real))
+		elif os.path.isfile(real):
+			return open(real).read()
+		else:
+			return -errno.EINVAL
+	
+ 	def getK5login(self, machine, **kw):
+		"""Build the ACL for a machine and turn it into a .k5login file
+		"""
+		machine = database.Machine.query().filter_by(name=machine).one()
+		users = [acl.user for acl in machine.acl]
+		return "\n".join(map(self.userToPrinc, users) + [''])
+	
+	def mirrorPath(self, path):
+		"""Translate a virtual path to its real path counterpart"""
+		return realpath + "/".join(getParts(path)[1:])
+	
+	def userToPrinc(self, user):
+		"""Convert Kerberos v4-style names to v5-style and append a default
+		realm if none is specified
+		"""
+		if '@' in user:
+			(princ, realm) = user.split('@')
+		else:
+			princ = user
+			realm = config.authn[0].realm
+		
+		return princ.replace('.', '/') + '@' + realm
+
+if __name__ == '__main__':
+	database.connect()
+	routefs.main(ConsoleFS)
Index: trunk/packages/sipb-xen-console/files/usr/bin/invirt-consolesh
===================================================================
--- trunk/packages/sipb-xen-console/files/usr/bin/invirt-consolesh	(revision 1200)
+++ trunk/packages/sipb-xen-console/files/usr/bin/invirt-consolesh	(revision 1200)
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec /usr/bin/console "$USER"
Index: trunk/packages/sipb-xen-console/files/usr/bin/sipb-xen-consolefs
===================================================================
--- trunk/packages/sipb-xen-console/files/usr/bin/sipb-xen-consolefs	(revision 1198)
+++ 	(revision )
@@ -1,92 +1,0 @@
-#!/usr/bin/python
-
-import routefs
-from routes import Mapper
-
-from syslog import *
-from time import time
-
-import os
-import errno
-
-from invirt.config import structs as config
-from invirt import database
-
-realpath = "/home/machines/"
-
-class ConsoleFS(routefs.RouteFS):
-	"""
-	ConsoleFS creates a series of subdirectories each mirroring the same real
-	directory, except for a single file - the .k5login - which is dynamically
-	generated for each subdirectory
-	"""
-	
-	def __init__(self, *args, **kw):
-		"""Initialize the filesystem and set it to allow_other access besides
-		the user who mounts the filesystem (i.e. root)
-		"""
-		super(ConsoleFS, self).__init__(*args, **kw)
-		self.lasttime = time()
-		self.fuse_args.add("allow_other", True)
-		
-		openlog('sipb-xen-consolefs ', LOG_PID, LOG_DAEMON)
-		
-		syslog(LOG_DEBUG, 'Init complete.')
-
-	def make_map(self):
-		m = Mapper()
-		m.connect('', controller='getMachines')
-		m.connect(':machine', controller='getMirror')
-		m.connect(':machine/.k5login', controller='getK5login')
-		m.connect(':machine/*(path)', controller='getMirror')
-		return m
-	
-	def getMachines(self, **kw):
-		"""Get the list of VMs in the database, clearing the cache if it's 
-		older than 15 seconds"""
-		if time() - self.lasttime > 15:
-			self.lasttime = time()
-			database.clear_cache()
-		return [machine.name for machine in database.Machine.query()]
-	
-	def getMirror(self, machine, path='', **kw):
-		"""Translate the path into its realpath equivalent, and return that
-		"""
-		real = realpath + path
-		if os.path.isdir(real):
-			# The list is converted to a set so that we can handle the case 
-			# where there is already a .k5login in the realpath gracefully	  
-			return routefs.Directory(set(os.listdir(real) + ['.k5login']))
-		elif os.path.islink(real):
-			return routefs.Symlink(os.readlink(real))
-		elif os.path.isfile(real):
-			return open(real).read()
-		else:
-			return -errno.EINVAL
-	
- 	def getK5login(self, machine, **kw):
-		"""Build the ACL for a machine and turn it into a .k5login file
-		"""
-		machine = database.Machine.query().filter_by(name=machine).one()
-		users = [acl.user for acl in machine.acl]
-		return "\n".join(map(self.userToPrinc, users) + [''])
-	
-	def mirrorPath(self, path):
-		"""Translate a virtual path to its real path counterpart"""
-		return realpath + "/".join(getParts(path)[1:])
-	
-	def userToPrinc(self, user):
-		"""Convert Kerberos v4-style names to v5-style and append a default
-		realm if none is specified
-		"""
-		if '@' in user:
-			(princ, realm) = user.split('@')
-		else:
-			princ = user
-			realm = config.authn[0].realm
-		
-		return princ.replace('.', '/') + '@' + realm
-
-if __name__ == '__main__':
-	database.connect()
-	routefs.main(ConsoleFS)
Index: trunk/packages/sipb-xen-console/files/usr/bin/sipb-xen-consolesh
===================================================================
--- trunk/packages/sipb-xen-console/files/usr/bin/sipb-xen-consolesh	(revision 1198)
+++ 	(revision )
@@ -1,2 +1,0 @@
-#!/bin/bash
-exec /usr/bin/console "$USER"
