Ignore:
Timestamp:
Jul 13, 2008, 8:57:03 AM (16 years ago)
Author:
price
Message:

multiplex conserver across hosts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-console-server/files/usr/sbin/sipb-xen-update-conserver

    r403 r672  
    44import subprocess
    55import os
     6import socket
    67
    78sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen')
     
    1920
    2021if __name__ == '__main__':
     22    hostname = socket.getfqdn().lower()
     23    config = '\n'.join('console %s { master %s; }' % (vm, hostname)
     24                       for vm in live_vms())
    2125    f = open('/etc/conserver/sipb-xen-consoles.cf', 'w')
    22     f.write('\n'.join('console %s {}' % vm for vm in live_vms()))
     26    f.write(config)
    2327    f.close()
    2428    reload_conserver()
     29    subprocess.call(['/usr/bin/kinit', '-k', '-t', '/etc/krb5.keytab',
     30                     'host/'+hostname+'@ATHENA.MIT.EDU'])
     31    subprocess.call(['/usr/bin/remctl', 'sipb-xen-console.mit.edu',
     32                     'console', 'update', config])
Note: See TracChangeset for help on using the changeset viewer.