use the FQDN for PLC_WWW_HOST rather than localhost to get cron.php
[myplc.git] / db-config
index ba9b0be..2c9f038 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -12,6 +12,7 @@
 
 from plc_config import PLCConfiguration
 import sys
+import resource
 
 def main():
     cfg = PLCConfiguration()
@@ -256,34 +257,6 @@ def main():
          'ignore_cmd_errors': False,
          'always_update': False},
 
-        # XXX Required for old Node Manager
-        # Proper configuration
-        {'enabled': True,
-         'source': 'PlanetLabConf/propd.conf',
-         'dest': '/etc/proper/propd.conf',
-         'file_permissions': '644',
-         'file_owner': 'root',
-         'file_group': 'root',
-         'preinstall_cmd': '',
-         'postinstall_cmd': '/etc/init.d/proper restart',
-         'error_cmd': '',
-         'ignore_cmd_errors': True,
-         'always_update': False},
-
-        # XXX Required for old Node Manager
-        # Bandwidth cap
-        {'enabled': True,
-         'source': 'PlanetLabConf/bwlimit.php',
-         'dest': '/etc/planetlab/bwcap',
-         'file_permissions': '644',
-         'file_owner': 'root',
-         'file_group': 'root',
-         'preinstall_cmd': '',
-         'postinstall_cmd': '',
-         'error_cmd': '',
-         'ignore_cmd_errors': True,
-         'always_update': False},
-
         # Proxy ARP setup
         {'enabled': True,
          'source': 'PlanetLabConf/proxies.php',
@@ -298,17 +271,6 @@ def main():
          'always_update': False},
 
         # Firewall configuration
-        {'enabled': True,
-         'source': 'PlanetLabConf/iptables',
-         'dest': '/etc/sysconfig/iptables',
-         'file_permissions': '600',
-         'file_owner': 'root',
-         'file_group': 'root',
-         'preinstall_cmd': '',
-         'postinstall_cmd': '',
-         'error_cmd': '',
-         'ignore_cmd_errors': False,
-         'always_update': False},
         {'enabled': True,
          'source': 'PlanetLabConf/blacklist.php',
          'dest': '/etc/planetlab/blacklist',
@@ -532,8 +494,26 @@ def main():
          'description': "Demux HTTP between slices using localhost ports. Value in the form 'host, localhost port'.",
          'min_role_id': 10},
 
+        # Delegation
+        {'name': "delegations",
+         'description': "Comma-seperated list of slices to give delegation authority to.",
+         'min_role_id': 10},
+
         ]
 
+    # add in the platform supported rlimits to the default_attribute_types
+    for entry in resource.__dict__.keys() + ["VLIMIT_OPENFD"]:
+        if entry.find("LIMIT_")==1:
+            rlim = entry[len("RLIMIT_"):]
+            rlim = rlim.lower()
+            for ty in ("min","soft","hard"):
+                attribute = {
+                    'name': "%s_%s"%(rlim,ty),
+                    'description': "Per sliver RLIMIT %s_%s."%(rlim,ty),
+                    'min_role_id': 10 #admin
+                    }
+                default_attribute_types.append(attribute)
+
     # Get list of existing attribute types
     attribute_types = GetSliceAttributeTypes()
     attribute_types = [attribute_type['name'] for attribute_type in attribute_types]
@@ -800,24 +780,18 @@ requirements.
 
 The most common reason for authentication failure is that the
 authentication key stored in the node configuration file, does not
-match the key on record. 
-
-There are two possible steps to resolve the problem.
+match the key stored in our database.  These keys must match in order to
+authenticate the node successfully.
 
-1. If you have used an All-in-one BootCD that includes the plnode.txt file,
-    then please check your machine for any old boot media, either in the
-    floppy drive, or on a USB stick.  It is likely that an old configuration
-    is being used instead of the new configuration stored on the BootCD.
-Or, 
-2. If you are using Generic BootCD image, then regenerate the node 
-    configuration file by visiting:
+Each time the configuration file is downloaded, either as part of an All-in-One
+BootImage or by downloading the plnode.txt file, the authentication key is
+RECREATED.  So, which ever file was downloaded most recently is the one we
+have in our database.  Often, users will download both the All-in-One image as
+well as the plnode.txt file, and inadvertently break the boot image.
 
-    https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
-
-    Under 'Download', follow the 'Download plnode.txt file for %(hostname)s'
-    option, and save the downloaded file as plnode.txt on either a floppy 
-    disk or a USB flash drive.  Be sure the 'Boot State' is set to 'Boot', 
-    and, then reboot the node.
+To repair this problem, simply download your All-in-One BootImage again, and
+copy it to the appropriate read-only boot media (write-protected USB or
+CD-ROM).  
 
 If you have already performed this step and are still receiving this
 message, please reply so that we can help investigate the problem.
@@ -1035,6 +1009,21 @@ message, please reply so that we may investigate the problem.
             for ptype in protocol_types:
                 AddPCUProtocolType(id, ptype)
 
+    # Run local db-config snippets
+    files = []
+    dir = "/etc/planetlab/db-config.d"
+    try:
+        files = os.listdir(dir)
+    except:
+        pass
+
+    for file in files:
+        if (file.endswith(".bak") or file.endswith("~") or
+            file.endswith(".rpmsave") or file.endswith(".rpmnew") or
+            file.endswith(".orig")):
+            continue
+        execfile(os.path.join(dir, file))
+
 
 if __name__ == '__main__':
     main()