X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=db-config;h=ebd5cde7a0d9e1b9a6958f783c79210b1c1385ec;hb=761e4782054a0085f1a328ad1cd1308de677142b;hp=2f8691f3c6fd599448277aa4fb9dd936bbac8953;hpb=2d5899145ec4d5fdd89f61b2bc347d767ba28c10;p=myplc.git diff --git a/db-config b/db-config index 2f8691f..ebd5cde 100755 --- a/db-config +++ b/db-config @@ -7,7 +7,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: db-config 7454 2007-12-11 18:55:00Z faiyaza $ +# $Id$ # $HeadURL$ from plc_config import PLCConfiguration @@ -393,7 +393,7 @@ def main(): # sudo configuration {'enabled': True, - 'source': 'PlanetLabConf/sudoers', + 'source': 'PlanetLabConf/sudoers.php', 'dest': '/etc/sudoers', 'file_permissions': '440', 'file_owner': 'root', @@ -450,8 +450,8 @@ def main(): 'min_role_id': 10}, # CPU share - {'name': "cpu_min", - 'description': "Minimum CPU share (ms/s)", + {'name': "cpu_pct", + 'description': "Reserved CPU percent", 'min_role_id': 10}, {'name': "cpu_share", 'description': "Number of CPU shares", @@ -497,7 +497,23 @@ def main(): # Proper operations {'name': "proper_op", 'description': "Proper operation (e.g. bind_socket)", - 'min_role_id': 10} + 'min_role_id': 10}, + + # VServer capabilities + {'name': "capabilities", + 'description': "VServer bcapabilities (separate by commas)", + 'min_role_id': 10}, + + # Vsys + {'name': "vsys", + 'description': "Bind vsys script fd's to a slice's vsys directory.", + 'min_role_id': 10}, + + # CoDemux + {'name': "codemux", + 'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.", + 'min_role_id': 10}, + ] # Get list of existing attribute types @@ -511,6 +527,26 @@ def main(): else: UpdateSliceAttributeType(default_attribute_type['name'], default_attribute_type) + # Default Initscripts + default_initscripts = [] + + # Find initscripts and add them to the db + for (root, dirs, files) in os.walk("/etc/plc_sliceinitscripts"): + for f in files: + # Read the file + file = open(root + "/" + f, "ro") + default_initscripts.append({"name": plc['slice_prefix'] + "_" + f, + "enabled": True, + "script": file.read().replace("@SITE@", url).replace("@PREFIX@", plc['slice_prefix'])}) + file.close() + + # Get list of existing initscripts + oldinitscripts = GetInitScripts() + oldinitscripts = [script['name'] for script in oldinitscripts] + + for initscript in default_initscripts: + if initscript['name'] not in oldinitscripts: AddInitScript(initscript) + # Setup default slice attribute types default_setting_types = [ @@ -518,20 +554,15 @@ def main(): 'name' : "ifname", 'description': "Set interface name, instead of eth0 or the like", 'min_role_id' : 40}, - {'category' : "general", - 'name' : "driver", - 'description': "Use this to specify an alternate driver", - 'min_role_id' : 40 }, - {'category' : "general", + {'category' : "Multihome", 'name' : "alias", - 'description': "Allows to reuse an interface as eth0:alias", + 'description': "Specifies that the network is used for multihoming", 'min_role_id' : 40}, {'category' : "hidden", 'name' : "backdoor", 'description': "For testing new settings", 'min_role_id' : 10}, - ] + [ { "category" : "WiFi", "name" : x, @@ -574,13 +605,25 @@ def main(): 'description': "PlanetFlow Traffic Auditing Service", 'url': url, 'instantiation': "plc-instantiated", - # Renew forever - 'expires': sys.maxint, + # Renew forever (minus one day, work around date conversion weirdness) + 'expires': 0x7fffffff - (60 * 60 * 24), 'attributes': [('system', "1"), ('vref', "planetflow"), ('proper_op', "open file=/etc/passwd, flags=r"), ('proper_op', "create_socket"), - ('proper_op', "bind_socket")]}, + ('proper_op', "bind_socket"), + ('vsys' , "pfmount")]}, + # Sirius + {'name': plc['slice_prefix'] + "_sirius", + 'description': 'The Sirius Calendar Service.\n\nSirius provides system-wide reservations of 25% CPU and 2Mb/s outgoing\nbandwidth. Sign up for hour-long slots using the Web GUI at the\nPlanetLab website.\n\nThis slice should not generate traffic external to PlanetLab.\n', + 'url': url, + 'instantiation': "plc-instantiated", + # Renew forever (minus one day, work around date conversion weirdness) + 'expires': 0x7fffffff - (60 * 60 * 24), + 'attributes': [('system', "1"), + ('net_min_rate', "2000"), + ('cpu_pct', "25"), + ('initscript', plc['slice_prefix'] + "_sirius")]} ] for default_slice in default_slices: