Index: package_tags/sipb-xen-console-server/2.02/debian/changelog
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/changelog	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/changelog	(revision 404)
@@ -0,0 +1,38 @@
+sipb-xen-console-server (2.02) unstable; urgency=low
+
+  * And...xm isn't in the path, so give a full path
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 04:48:53 -0400
+
+sipb-xen-console-server (2.01) unstable; urgency=low
+
+  * update-conserver script should reload, not restart
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 04:43:12 -0400
+
+sipb-xen-console-server (2) unstable; urgency=low
+
+  * Use a python based update-conserver script that gets the list of
+    consoles from xm list
+  * Run the update-conserver script every 5 minutes to catch VMs that
+    are not started or stopped through the remctl interface
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 04:32:58 -0400
+
+sipb-xen-console-server (1.0.2) unstable; urgency=low
+
+  * Also...make this package actually do something
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 01:41:32 -0400
+
+sipb-xen-console-server (1.0.1) unstable; urgency=low
+
+  * Misnamed a file
+
+ -- Evan Broder <broder@sipb-xen-dev.mit.edu>  Wed,  2 Apr 2008 01:36:29 -0400
+
+sipb-xen-console-server (1) unstable; urgency=low
+
+  * Initial release.
+
+ -- SIPB Xen Project <sipb-xen@mit.edu>  Wed,  2 Apr 2008 00:27:12 -0400
Index: package_tags/sipb-xen-console-server/2.02/debian/compat
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/compat	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/compat	(revision 404)
@@ -0,0 +1,1 @@
+5
Index: package_tags/sipb-xen-console-server/2.02/debian/control
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/control	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/control	(revision 404)
@@ -0,0 +1,14 @@
+Source: sipb-xen-console-server
+Section: servers
+Priority: important
+Maintainer: sipb-xen@mit.edu
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), config-package-dev
+Standards-Version: 3.7.2
+
+Package: sipb-xen-console-server
+Architecture: all
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-server
+Description: SIPB Xen serial console server server
+  This configures the VMM for the server-side of the console server
Index: package_tags/sipb-xen-console-server/2.02/debian/control.in
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/control.in	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/control.in	(revision 404)
@@ -0,0 +1,14 @@
+Source: sipb-xen-console-server
+Section: servers
+Priority: important
+Maintainer: sipb-xen@mit.edu
+Build-Depends: @cdbs@
+Standards-Version: 3.7.2
+
+Package: sipb-xen-console-server
+Architecture: all
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-server
+Description: SIPB Xen serial console server server
+  This configures the VMM for the server-side of the console server
Index: package_tags/sipb-xen-console-server/2.02/debian/copyright
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/copyright	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/copyright	(revision 404)
@@ -0,0 +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
+you have questions about redistribution.
Index: package_tags/sipb-xen-console-server/2.02/debian/rules
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/rules	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/rules	(revision 404)
@@ -0,0 +1,9 @@
+#!/usr/bin/make -f
+
+DEB_AUTO_UPDATE_DEBIAN_CONTROL = 1
+DEB_DIVERT_EXTENSION = .sipb-xen
+DEB_DIVERT_FILES_sipb-xen-console += \
+	/etc/conserver/conserver.cf
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/replace-files.mk
Index: package_tags/sipb-xen-console-server/2.02/debian/sipb-xen-console-server.cron.d
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/sipb-xen-console-server.cron.d	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/sipb-xen-console-server.cron.d	(revision 404)
@@ -0,0 +1,8 @@
+#
+# cron-jobs for sipb-xen-console-server
+# Refresh the list of active VM consoles
+#
+
+MAILTO=root
+
+*/5 * * * * root python /usr/sbin/sipb-xen-update-conserver
Index: package_tags/sipb-xen-console-server/2.02/debian/sipb-xen-console-server.install
===================================================================
--- package_tags/sipb-xen-console-server/2.02/debian/sipb-xen-console-server.install	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/debian/sipb-xen-console-server.install	(revision 404)
@@ -0,0 +1,1 @@
+files/* .
Index: package_tags/sipb-xen-console-server/2.02/files/etc/conserver/conserver.cf.sipb-xen
===================================================================
--- package_tags/sipb-xen-console-server/2.02/files/etc/conserver/conserver.cf.sipb-xen	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/files/etc/conserver/conserver.cf.sipb-xen	(revision 404)
@@ -0,0 +1,36 @@
+# The character '&' in logfile names are substituted with the console
+# name.
+#
+
+config * {
+	sslrequired yes;
+}
+default full {
+	rw *;
+}
+default * {
+	master black-mesa;
+	logfile /var/log/conserver/&.log;
+	timestamp "1lab";
+	include full;
+	type exec;
+	exec xm console d_f;
+	execsubst f=cs;
+}
+
+console s_sipb-xen-dev {
+	type exec;
+	exec xm console s_sipb-xen-dev;
+}
+
+#include /etc/conserver/sipb-xen-consoles.cf
+
+##
+## list of clients we allow
+##
+access * {
+	allowed 127.0.0.1;
+	trusted 18.181.0.134;
+	limited *;
+}
+
Index: package_tags/sipb-xen-console-server/2.02/files/usr/sbin/sipb-xen-update-conserver
===================================================================
--- package_tags/sipb-xen-console-server/2.02/files/usr/sbin/sipb-xen-update-conserver	(revision 404)
+++ package_tags/sipb-xen-console-server/2.02/files/usr/sbin/sipb-xen-update-conserver	(revision 404)
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sipb_xen_database
+import subprocess
+import os
+
+sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
+
+def live_vms():
+    p = subprocess.Popen(['/usr/sbin/xm', 'list'], stdout=subprocess.PIPE)
+    p.wait()
+    output = p.stdout.read()
+    vms = [x.split()[0][2:] for x in output.splitlines() if x.startswith('d_')]
+    return vms
+
+def reload_conserver():
+    p = subprocess.Popen(['/etc/init.d/conserver-server', 'reload'], stdout=subprocess.PIPE)
+    p.wait()
+
+if __name__ == '__main__':
+    f = open('/etc/conserver/sipb-xen-consoles.cf', 'w')
+    f.write('\n'.join('console %s {}' % vm for vm in live_vms()))
+    f.close()
+    reload_conserver()
