Index: unk/packages/invirt-console-host/debian/changelog
===================================================================
--- /trunk/packages/invirt-console-host/debian/changelog	(revision 1814)
+++ 	(revision )
@@ -1,164 +1,0 @@
-invirt-console-host (0.0.10) unstable; urgency=low
-
-  * Clean up the old sudoers block in the postinst before we add it back
-
- -- Evan Broder <broder@mit.edu>  Tue, 25 Nov 2008 08:13:32 -0500
-
-invirt-console-host (0.0.9) unstable; urgency=low
-
-  * Add cron dependency
-
- -- Evan Broder <broder@mit.edu>  Thu, 20 Nov 2008 11:01:03 -0500
-
-invirt-console-host (0.0.8) unstable; urgency=low
-
-  * Specify a full path to invoke-rc.d for when this gets run as a cron
-    job
-
- -- Evan Broder <broder@mit.edu>  Thu, 06 Nov 2008 18:57:02 -0500
-
-invirt-console-host (0.0.7) unstable; urgency=low
-
-  * Use invoke-rc.d instead of calling init scripts directly
-
- -- Evan Broder <broder@mit.edu>  Fri, 31 Oct 2008 06:29:20 -0400
-
-invirt-console-host (0.0.6) unstable; urgency=low
-
-  * sipb-xen-base -> invirt-base
-
- -- Evan Broder <broder@mit.edu>  Tue, 28 Oct 2008 04:23:12 -0400
-
-invirt-console-host (0.0.5) unstable; urgency=low
-
-  * invirt-console-host doesn't use the database anymore, so don't connect
-    to it
-
- -- Evan Broder <broder@mit.edu>  Sat, 25 Oct 2008 14:09:03 -0400
-
-invirt-console-host (0.0.4) unstable; urgency=low
-
-  * Kill DEB_AUTO_UPDATE_DEBIAN_CONTROL
-
- -- Evan Broder <broder@mit.edu>  Fri, 24 Oct 2008 13:46:46 -0400
-
-invirt-console-host (0.0.3) unstable; urgency=low
-
-  * make initscript even shorter, with code now provided by sipb-xen-base
-
- -- Greg Price <price@mit.edu>  Fri, 24 Oct 2008 07:07:46 -0400
-
-invirt-console-host (0.0.2) unstable; urgency=low
-
-  * make initscript start conserver on start/restart, not just reload
-  * drastically shorten initscript to current Invirt best practice,
-    in hopes that such dumb bugs can't hide so easily
-
- -- Greg Price <price@mit.edu>  Fri, 24 Oct 2008 03:33:32 -0400
-
-invirt-console-host (0.0.1) unstable; urgency=low
-
-  * sipb-xen -> invirt
-  * -server -> -host while we're at it
-
- -- Greg Price <price@mit.edu>  Fri, 24 Oct 2008 01:23:56 -0400
-
-sipb-xen-console-server (2.8) unstable; urgency=low
-
-  * Create a dummy console entry that exists by default so that conserver
-    won't quit if no consoles are defined.
-
- -- Evan Broder <broder@mit.edu>  Tue, 14 Oct 2008 03:10:28 -0400
-
-sipb-xen-console-server (2.7) unstable; urgency=low
-
-  * Don't run conserver as root; use sudo instead
-
- -- Evan Broder <broder@mit.edu>  Tue, 14 Oct 2008 02:38:46 -0400
-
-sipb-xen-console-server (2.06.3) unstable; urgency=low
-
-  * Running conserver as root so it can run xm console
-
- -- Evan Broder <broder@mit.edu>  Tue, 14 Oct 2008 01:42:26 -0400
-
-sipb-xen-console-server (2.06.2) unstable; urgency=low
-
-  * No really - correctly divert conserver.cf
-
- -- Evan Broder <broder@mit.edu>  Tue, 14 Oct 2008 01:39:09 -0400
-
-sipb-xen-console-server (2.06.1) unstable; urgency=low
-
-  * Correctly divert conserver.cf
-
- -- Evan Broder <broder@mit.edu>  Tue, 14 Oct 2008 01:34:25 -0400
-
-sipb-xen-console-server (2.06) unstable; urgency=low
-
-  * generate config files using mako
-
- -- Yang Zhang <y_z@mit.edu>  Thu, 14 Aug 2008 15:15:18 -0400
-
-sipb-xen-console-server (2.05) unstable; urgency=low
-
-  * use invirt.config rather than /etc/invirt/* directly
-  * get console-server hostname, db connection string from config
-  * generate conserver config piece needing console-server ip
-  * remove console 's_sipb-xen-dev', which doesn't work anyway
-  * all configured!
-
- -- Greg Price <price@mit.edu>  Sat,  2 Aug 2008 18:58:59 -0400
-
-sipb-xen-console-server (2.04) unstable; urgency=low
-
-  * Get Kerberos realm from config rather than hardcoding.
-  * Don't hardcode host's hostname in conserver.cf.
-  * Update for current config-package-dev.
-
- -- Greg Price <price@mit.edu>  Tue, 22 Jul 2008 01:32:04 -0400
-
-sipb-xen-console-server (2.03) unstable; urgency=low
-
-  * Multiplex consoles on multiple hosts.
-
- -- Greg Price <price@mit.edu>  Sun, 13 Jul 2008 08:35:17 -0400
-
-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: unk/packages/invirt-console-host/debian/compat
===================================================================
--- /trunk/packages/invirt-console-host/debian/compat	(revision 1814)
+++ 	(revision )
@@ -1,1 +1,0 @@
-5
Index: unk/packages/invirt-console-host/debian/control
===================================================================
--- /trunk/packages/invirt-console-host/debian/control	(revision 1814)
+++ 	(revision )
@@ -1,14 +1,0 @@
-Source: invirt-console-host
-Section: servers
-Priority: important
-Maintainer: invirt@mit.edu
-Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), config-package-dev (>= 4.5~)
-Standards-Version: 3.7.2
-
-Package: invirt-console-host
-Architecture: all
-Provides: ${diverted-files}
-Conflicts: ${diverted-files}
-Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-server, remctl-client, invirt-base, cron
-Description: SIPB Xen serial console server server
-  This configures the VMM for the server-side of the console server
Index: unk/packages/invirt-console-host/debian/copyright
===================================================================
--- /trunk/packages/invirt-console-host/debian/copyright	(revision 1814)
+++ 	(revision )
@@ -1,16 +1,0 @@
-This software was written as part of the Invirt project <invirt@mit.edu>.
-
-Copyright :
-
-  This program is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-On Debian systems, the complete text of the GNU General Public License
-can be found in the file /usr/share/common-licenses/GPL.
Index: unk/packages/invirt-console-host/debian/invirt-console-host.cron.d
===================================================================
--- /trunk/packages/invirt-console-host/debian/invirt-console-host.cron.d	(revision 1814)
+++ 	(revision )
@@ -1,8 +1,0 @@
-#
-# cron-jobs for invirt-console-host
-# Refresh the list of active VM consoles
-#
-
-MAILTO=root
-
-*/5 * * * * root python /usr/sbin/invirt-update-conserver
Index: unk/packages/invirt-console-host/debian/invirt-console-host.init
===================================================================
--- /trunk/packages/invirt-console-host/debian/invirt-console-host.init	(revision 1814)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#! /bin/bash
-### BEGIN INIT INFO
-# Provides:          invirt-console-host
-# 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: conserver config from invirt-config for Invirt host
-# Description:       
-### END INIT INFO
-
-PACKAGE=invirt-console-host
-PARENTPACKAGE=conserver-server
-GEN_FILES=/etc/conserver/invirt-genconfig.cf
-
-dpkg -s "$PACKAGE" >/dev/null 2>/dev/null || exit 0
-
-. /lib/init/config-init.sh
-config_init $1
Index: unk/packages/invirt-console-host/debian/invirt-console-host.install
===================================================================
--- /trunk/packages/invirt-console-host/debian/invirt-console-host.install	(revision 1814)
+++ 	(revision )
@@ -1,1 +1,0 @@
-files/* .
Index: unk/packages/invirt-console-host/debian/invirt-console-host.postinst
===================================================================
--- /trunk/packages/invirt-console-host/debian/invirt-console-host.postinst	(revision 1814)
+++ 	(revision )
@@ -1,47 +1,0 @@
-#!/bin/sh
-# postinst script for invirt-console-host
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <postinst> `abort-remove'
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    configure)
-        # Clean up the old sudoers line before we add it back
-        perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
-        
-        cat >>/etc/sudoers <<EOF
-### BEGIN invirt-console-host
-conservr ALL=(ALL) NOPASSWD: /usr/sbin/xm console d_*
-### END invirt-console-host
-EOF
-    ;;
-
-    abort-upgrade|abort-remove|abort-deconfigure)
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
Index: unk/packages/invirt-console-host/debian/invirt-console-host.prerm
===================================================================
--- /trunk/packages/invirt-console-host/debian/invirt-console-host.prerm	(revision 1814)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#!/bin/sh
-# prerm script for invirt-console-host
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <prerm> `remove'
-#        * <old-prerm> `upgrade' <new-version>
-#        * <new-prerm> `failed-upgrade' <old-version>
-#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-#        * <deconfigured's-prerm> `deconfigure' `in-favour'
-#          <package-being-installed> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    remove|upgrade|deconfigure)
-        perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
-    ;;
-
-    failed-upgrade)
-    ;;
-
-    *)
-        echo "prerm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
Index: unk/packages/invirt-console-host/debian/rules
===================================================================
--- /trunk/packages/invirt-console-host/debian/rules	(revision 1814)
+++ 	(revision )
@@ -1,9 +1,0 @@
-#!/usr/bin/make -f
-
-DEB_DIVERT_EXTENSION = .invirt
-DEB_DIVERT_FILES_invirt-console-host += \
-	/etc/conserver/conserver.cf.invirt \
-	/etc/conserver/server.conf.invirt
-
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/config-package.mk
Index: unk/packages/invirt-console-host/files/etc/conserver/conserver.cf.invirt
===================================================================
--- /trunk/packages/invirt-console-host/files/etc/conserver/conserver.cf.invirt	(revision 1814)
+++ 	(revision )
@@ -1,25 +1,0 @@
-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 * {
-	logfile /var/log/conserver/&.log;
-	timestamp "1lab";
-	rw *;
-	type exec;
-	exec sudo xm console d_f;
-	execsubst f=cs;
-}
-
-#include /etc/conserver/invirt-genconfig.cf
-#include /etc/conserver/invirt-consoles.cf
Index: unk/packages/invirt-console-host/files/etc/conserver/invirt-genconfig.cf.mako
===================================================================
--- /trunk/packages/invirt-console-host/files/etc/conserver/invirt-genconfig.cf.mako	(revision 1814)
+++ 	(revision )
@@ -1,6 +1,0 @@
-<% from invirt.config import structs as cfg %>\
-access * {
-       trusted 127.0.0.1;
-       trusted ${cfg.console.ip};
-       limited *;
-}
Index: unk/packages/invirt-console-host/files/etc/conserver/server.conf.invirt
===================================================================
--- /trunk/packages/invirt-console-host/files/etc/conserver/server.conf.invirt	(revision 1814)
+++ 	(revision )
@@ -1,2 +1,0 @@
-OPTS='-p 3109  '
-ASROOT=
Index: unk/packages/invirt-console-host/files/usr/sbin/invirt-update-conserver
===================================================================
--- /trunk/packages/invirt-console-host/files/usr/sbin/invirt-update-conserver	(revision 1814)
+++ 	(revision )
@@ -1,32 +1,0 @@
-#!/usr/bin/python
-
-import subprocess
-import os
-import socket
-from invirt.config import structs as config
-
-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(['/usr/sbin/invoke-rc.d', 'conserver-server', 'reload'], stdout=subprocess.PIPE)
-    p.wait()
-
-if __name__ == '__main__':
-    hostname = socket.getfqdn().lower()
-    realm = config.authn[0].realm
-    principal = 'host/'+hostname+'@'+realm
-    conftext = '\n'.join('console %s { master %s; }' % (vm, hostname)
-                         for vm in live_vms())
-    f = open('/etc/conserver/invirt-consoles.cf', 'w')
-    f.write(conftext)
-    f.close()
-    reload_conserver()
-    subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
-                     principal])
-    subprocess.call(['/usr/bin/remctl', config.console.hostname,
-                     'console', 'update', conftext])
Index: /trunk/packages/invirt-console/debian/changelog
===================================================================
--- /trunk/packages/invirt-console/debian/changelog	(revision 1814)
+++ /trunk/packages/invirt-console/debian/changelog	(revision 1815)
@@ -3,6 +3,7 @@
   * Rename source package in preparation for merging invirt-console-server
     with invirt-console-host
-
- -- Evan Broder <broder@mit.edu>  Sun, 07 Dec 2008 10:10:36 -0500
+  * Merge invirt-console-host into invirt-console (LP: #305681)
+
+ -- Evan Broder <broder@mit.edu>  Sun, 07 Dec 2008 10:17:06 -0500
 
 invirt-console-server (0.1.3) unstable; urgency=low
Index: /trunk/packages/invirt-console/debian/control
===================================================================
--- /trunk/packages/invirt-console/debian/control	(revision 1814)
+++ /trunk/packages/invirt-console/debian/control	(revision 1815)
@@ -16,2 +16,10 @@
 Description: Invirt serial-console proxy server
  This is the software for the serial-console proxy server.
+
+Package: invirt-console-host
+Architecture: all
+Provides: ${diverted-files}
+Conflicts: ${diverted-files}
+Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-server, remctl-client, invirt-base, cron
+Description: SIPB Xen serial console server server
+  This configures the VMM for the server-side of the console server
Index: /trunk/packages/invirt-console/debian/invirt-console-host.cron.d
===================================================================
--- /trunk/packages/invirt-console/debian/invirt-console-host.cron.d	(revision 1815)
+++ /trunk/packages/invirt-console/debian/invirt-console-host.cron.d	(revision 1815)
@@ -0,0 +1,8 @@
+#
+# cron-jobs for invirt-console-host
+# Refresh the list of active VM consoles
+#
+
+MAILTO=root
+
+*/5 * * * * root python /usr/sbin/invirt-update-conserver
Index: /trunk/packages/invirt-console/debian/invirt-console-host.init
===================================================================
--- /trunk/packages/invirt-console/debian/invirt-console-host.init	(revision 1815)
+++ /trunk/packages/invirt-console/debian/invirt-console-host.init	(revision 1815)
@@ -0,0 +1,19 @@
+#! /bin/bash
+### BEGIN INIT INFO
+# Provides:          invirt-console-host
+# 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: conserver config from invirt-config for Invirt host
+# Description:       
+### END INIT INFO
+
+PACKAGE=invirt-console-host
+PARENTPACKAGE=conserver-server
+GEN_FILES=/etc/conserver/invirt-genconfig.cf
+
+dpkg -s "$PACKAGE" >/dev/null 2>/dev/null || exit 0
+
+. /lib/init/config-init.sh
+config_init $1
Index: /trunk/packages/invirt-console/debian/invirt-console-host.install
===================================================================
--- /trunk/packages/invirt-console/debian/invirt-console-host.install	(revision 1815)
+++ /trunk/packages/invirt-console/debian/invirt-console-host.install	(revision 1815)
@@ -0,0 +1,1 @@
+host/* .
Index: /trunk/packages/invirt-console/debian/invirt-console-host.postinst
===================================================================
--- /trunk/packages/invirt-console/debian/invirt-console-host.postinst	(revision 1815)
+++ /trunk/packages/invirt-console/debian/invirt-console-host.postinst	(revision 1815)
@@ -0,0 +1,47 @@
+#!/bin/sh
+# postinst script for invirt-console-host
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+        # Clean up the old sudoers line before we add it back
+        perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
+        
+        cat >>/etc/sudoers <<EOF
+### BEGIN invirt-console-host
+conservr ALL=(ALL) NOPASSWD: /usr/sbin/xm console d_*
+### END invirt-console-host
+EOF
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Index: /trunk/packages/invirt-console/debian/invirt-console-host.prerm
===================================================================
--- /trunk/packages/invirt-console/debian/invirt-console-host.prerm	(revision 1815)
+++ /trunk/packages/invirt-console/debian/invirt-console-host.prerm	(revision 1815)
@@ -0,0 +1,39 @@
+#!/bin/sh
+# prerm script for invirt-console-host
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+        perl -i.bak -ne 's%^### (BEGIN|END) invirt-console-host\s*$%%m && ($skip = ($1 eq "BEGIN")); print unless $skip;' /etc/sudoers
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Index: /trunk/packages/invirt-console/debian/rules
===================================================================
--- /trunk/packages/invirt-console/debian/rules	(revision 1814)
+++ /trunk/packages/invirt-console/debian/rules	(revision 1815)
@@ -17,4 +17,7 @@
 	/etc/conserver/conserver.cf.invirt \
 	/etc/motd.invirt
+DEB_DIVERT_FILES_invirt-console-host += \
+	/etc/conserver/conserver.cf.invirt \
+	/etc/conserver/server.conf.invirt
 
 include /usr/share/cdbs/1/rules/debhelper.mk
Index: /trunk/packages/invirt-console/host/etc/conserver/conserver.cf.invirt
===================================================================
--- /trunk/packages/invirt-console/host/etc/conserver/conserver.cf.invirt	(revision 1815)
+++ /trunk/packages/invirt-console/host/etc/conserver/conserver.cf.invirt	(revision 1815)
@@ -0,0 +1,25 @@
+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 * {
+	logfile /var/log/conserver/&.log;
+	timestamp "1lab";
+	rw *;
+	type exec;
+	exec sudo xm console d_f;
+	execsubst f=cs;
+}
+
+#include /etc/conserver/invirt-genconfig.cf
+#include /etc/conserver/invirt-consoles.cf
Index: /trunk/packages/invirt-console/host/etc/conserver/invirt-genconfig.cf.mako
===================================================================
--- /trunk/packages/invirt-console/host/etc/conserver/invirt-genconfig.cf.mako	(revision 1815)
+++ /trunk/packages/invirt-console/host/etc/conserver/invirt-genconfig.cf.mako	(revision 1815)
@@ -0,0 +1,6 @@
+<% from invirt.config import structs as cfg %>\
+access * {
+       trusted 127.0.0.1;
+       trusted ${cfg.console.ip};
+       limited *;
+}
Index: /trunk/packages/invirt-console/host/etc/conserver/server.conf.invirt
===================================================================
--- /trunk/packages/invirt-console/host/etc/conserver/server.conf.invirt	(revision 1815)
+++ /trunk/packages/invirt-console/host/etc/conserver/server.conf.invirt	(revision 1815)
@@ -0,0 +1,2 @@
+OPTS='-p 3109  '
+ASROOT=
Index: /trunk/packages/invirt-console/host/usr/sbin/invirt-update-conserver
===================================================================
--- /trunk/packages/invirt-console/host/usr/sbin/invirt-update-conserver	(revision 1815)
+++ /trunk/packages/invirt-console/host/usr/sbin/invirt-update-conserver	(revision 1815)
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+import subprocess
+import os
+import socket
+from invirt.config import structs as config
+
+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(['/usr/sbin/invoke-rc.d', 'conserver-server', 'reload'], stdout=subprocess.PIPE)
+    p.wait()
+
+if __name__ == '__main__':
+    hostname = socket.getfqdn().lower()
+    realm = config.authn[0].realm
+    principal = 'host/'+hostname+'@'+realm
+    conftext = '\n'.join('console %s { master %s; }' % (vm, hostname)
+                         for vm in live_vms())
+    f = open('/etc/conserver/invirt-consoles.cf', 'w')
+    f.write(conftext)
+    f.close()
+    reload_conserver()
+    subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
+                     principal])
+    subprocess.call(['/usr/bin/remctl', config.console.hostname,
+                     'console', 'update', conftext])
