From a439f1f6e4a9d31ec211fe448215119df09ecd14 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sun, 13 Jul 2008 08:57:03 -0400 Subject: [PATCH] multiplex conserver across hosts svn path=/trunk/packages/sipb-xen-console/; revision=672 --- debian/changelog | 6 ++++++ debian/control | 2 +- debian/control.in | 2 +- files/etc/conserver/conserver.cf.sipb-xen | 13 ++++++++++--- files/etc/conserver/console.cf | 5 +++++ files/etc/conserver/invirt-hosts.cf | 2 ++ files/etc/remctl/acl/invirt-console | 2 ++ files/etc/remctl/conf.d/invirt-console | 1 + files/usr/sbin/invirt-console-update | 18 ++++++++++++++++++ 9 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 files/etc/conserver/console.cf create mode 100644 files/etc/conserver/invirt-hosts.cf create mode 100644 files/etc/remctl/acl/invirt-console create mode 100644 files/etc/remctl/conf.d/invirt-console create mode 100755 files/usr/sbin/invirt-console-update diff --git a/debian/changelog b/debian/changelog index b2e6f93..37c5607 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sipb-xen-console (7.2) unstable; urgency=low + + * Multiplex consoles on multiple hosts. + + -- Greg Price Sun, 13 Jul 2008 08:52:18 -0400 + sipb-xen-console (7.1) unstable; urgency=low * Remember to actually divert the conserver config diff --git a/debian/control b/debian/control index 45c1c52..7644fc5 100644 --- a/debian/control +++ b/debian/control @@ -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. diff --git a/debian/control.in b/debian/control.in index cde340c..e87c118 100644 --- a/debian/control.in +++ b/debian/control.in @@ -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. diff --git a/files/etc/conserver/conserver.cf.sipb-xen b/files/etc/conserver/conserver.cf.sipb-xen index a480b85..2142ed0 100644 --- a/files/etc/conserver/conserver.cf.sipb-xen +++ b/files/etc/conserver/conserver.cf.sipb-xen @@ -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 index 0000000..73c3321 --- /dev/null +++ b/files/etc/conserver/console.cf @@ -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 index 0000000..c038cdf --- /dev/null +++ b/files/etc/conserver/invirt-hosts.cf @@ -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 index 0000000..1cfd858 --- /dev/null +++ b/files/etc/remctl/acl/invirt-console @@ -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 index 0000000..86b37aa --- /dev/null +++ b/files/etc/remctl/conf.d/invirt-console @@ -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 index 0000000..d5035e6 --- /dev/null +++ b/files/usr/sbin/invirt-console-update @@ -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)) -- 1.7.9.5