multiplex conserver across hosts
authorGreg Price <price@mit.edu>
Sun, 13 Jul 2008 12:57:03 +0000 (08:57 -0400)
committerGreg Price <price@mit.edu>
Sun, 13 Jul 2008 12:57:03 +0000 (08:57 -0400)
svn path=/trunk/packages/sipb-xen-console/; revision=672

debian/changelog
debian/control
debian/control.in
files/etc/conserver/conserver.cf.sipb-xen
files/etc/conserver/console.cf [new file with mode: 0644]
files/etc/conserver/invirt-hosts.cf [new file with mode: 0644]
files/etc/remctl/acl/invirt-console [new file with mode: 0644]
files/etc/remctl/conf.d/invirt-console [new file with mode: 0644]
files/usr/sbin/invirt-console-update [new file with mode: 0755]

index b2e6f93..37c5607 100644 (file)
@@ -1,3 +1,9 @@
+sipb-xen-console (7.2) unstable; urgency=low
+
+  * Multiplex consoles on multiple hosts.
+  
+ -- Greg Price <price@mit.edu>  Sun, 13 Jul 2008 08:52:18 -0400
+
 sipb-xen-console (7.1) unstable; urgency=low
 
   * Remember to actually divert the conserver config
index 45c1c52..7644fc5 100644 (file)
@@ -9,7 +9,7 @@ Package: sipb-xen-console
 Architecture: all
 Provides: ${diverted-files}
 Conflicts: ${diverted-files}
-Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-client, daemon, debathena-kerberos-config, fuse-utils, libnss-pgsql1, nscd, openssh-server, python-fuse, sipb-xen-chrony-config, sipb-xen-database-common
+Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-client, daemon, debathena-kerberos-config, fuse-utils, libnss-pgsql1, nscd, openssh-server, python-fuse, sipb-xen-chrony-config, sipb-xen-database-common, remctl-server
 Description: SIPB Xen serial console server
  This package  should be installed on sipb-xen-console
  It makes sure that necessary tools are available.
index cde340c..e87c118 100644 (file)
@@ -9,7 +9,7 @@ Package: sipb-xen-console
 Architecture: all
 Provides: ${diverted-files}
 Conflicts: ${diverted-files}
-Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-client, daemon, debathena-kerberos-config, fuse-utils, libnss-pgsql1, nscd, openssh-server, python-fuse, sipb-xen-chrony-config, sipb-xen-database-common
+Depends: ${shlibs:Depends}, ${misc:Depends}, conserver-client, daemon, debathena-kerberos-config, fuse-utils, libnss-pgsql1, nscd, openssh-server, python-fuse, sipb-xen-chrony-config, sipb-xen-database-common, remctl-server
 Description: SIPB Xen serial console server
  This package  should be installed on sipb-xen-console
  It makes sure that necessary tools are available.
index a480b85..2142ed0 100644 (file)
@@ -1,6 +1,13 @@
 # default config for console
 config * {
-       master  black-mesa;
-       port    3109;
-       sslenabled yes;
+       sslrequired yes;
 }
+default * {
+        type exec;
+}
+access * {
+        trusted 127.0.0.1;
+        limited *;
+}
+
+#include /etc/conserver/invirt-hosts.cf
diff --git a/files/etc/conserver/console.cf b/files/etc/conserver/console.cf
new file mode 100644 (file)
index 0000000..73c3321
--- /dev/null
@@ -0,0 +1,5 @@
+config * {
+  master localhost;
+  port   3109;
+  sslenabled yes;
+}
diff --git a/files/etc/conserver/invirt-hosts.cf b/files/etc/conserver/invirt-hosts.cf
new file mode 100644 (file)
index 0000000..c038cdf
--- /dev/null
@@ -0,0 +1,2 @@
+#include /etc/conserver/conf.d/black-mesa.mit.edu
+#include /etc/conserver/conf.d/sx-blade-2.mit.edu
diff --git a/files/etc/remctl/acl/invirt-console b/files/etc/remctl/acl/invirt-console
new file mode 100644 (file)
index 0000000..1cfd858
--- /dev/null
@@ -0,0 +1,2 @@
+host/black-mesa.mit.edu@ATHENA.MIT.EDU
+host/sx-blade-2.mit.edu@ATHENA.MIT.EDU
diff --git a/files/etc/remctl/conf.d/invirt-console b/files/etc/remctl/conf.d/invirt-console
new file mode 100644 (file)
index 0000000..86b37aa
--- /dev/null
@@ -0,0 +1 @@
+console update /usr/sbin/invirt-console-update /etc/remctl/acl/invirt-console
diff --git a/files/usr/sbin/invirt-console-update b/files/usr/sbin/invirt-console-update
new file mode 100755 (executable)
index 0000000..d5035e6
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+import sys
+import os
+import subprocess
+
+def main(args):
+  contents = args[2]
+  hostname = os.environ['REMOTE_HOST'].lower()
+  f = file('/etc/conserver/conf.d/'+hostname, 'w')
+  f.write(contents)
+  f.close()
+  p = subprocess.Popen(['/etc/init.d/conserver-server', 'reload'],
+                       stdout=subprocess.PIPE)
+  p.wait()
+  return 0
+
+if __name__ == '__main__':
+  sys.exit(main(sys.argv))