Setting tag nodeconfig-5.0-1 nodeconfig-5.0-1
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 29 Jan 2010 14:35:25 +0000 (14:35 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 29 Jan 2010 14:35:25 +0000 (14:35 +0000)
first working version of 5.0:
pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
the yum/ and boot/ subdirs have moved away from here

31 files changed:
Makefile
PlanetLabConf/RPM-GPG-KEY-fedora [deleted file]
PlanetLabConf/blacklist.php
PlanetLabConf/bwlimit.php [deleted file]
PlanetLabConf/extensions.php [new file with mode: 0755]
PlanetLabConf/get_plc_config.php
PlanetLabConf/iptables-Internet2 [deleted file]
PlanetLabConf/keys.php
PlanetLabConf/ntp.conf.php
PlanetLabConf/ntp/ntp.conf.de
PlanetLabConf/ntp/ntp.conf.tp.pl [new file with mode: 0755]
PlanetLabConf/ntp/ntp.conf.tpnet.pl [new file with mode: 0755]
PlanetLabConf/ntptickers.php [deleted file]
PlanetLabConf/proxies.php
PlanetLabConf/sfa_config.php [new file with mode: 0755]
PlanetLabConf/sudoers [deleted file]
PlanetLabConf/sysctl-ip_forward.php [new file with mode: 0755]
PlanetLabConf/sysctl.conf [new file with mode: 0644]
PlanetLabConf/sysctl.php [deleted file]
PlanetLabConf/yum.conf.php [deleted file]
boot/getnodeid.php [deleted file]
boot/index.php [deleted file]
boot/uudecode.gz [deleted file]
db-config.d/030-conf_files_iptables [new file with mode: 0644]
db-config.d/030-conf_files_kernel [new file with mode: 0644]
db-config.d/030-conf_files_ping_of_death [new file with mode: 0644]
db-config.d/030-conf_files_plc_config [new file with mode: 0644]
db-config.d/030-conf_files_security [new file with mode: 0644]
db-config.d/030-conf_files_services [new file with mode: 0644]
db-config.d/030-conf_files_sfa [new file with mode: 0644]
nodeconfig.spec

index 61e5690..dce5ef7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@
 tags:
        find . -type f | grep -v '/\.svn/' | egrep -v '/(uudecode.gz|tags|TAGS)$$' | xargs etags
 
+.PHONY: tags
+
 ########## make sync PLCHOST=hostname VSERVER=vservername
 ifdef PLCHOST
 ifdef VSERVER
diff --git a/PlanetLabConf/RPM-GPG-KEY-fedora b/PlanetLabConf/RPM-GPG-KEY-fedora
deleted file mode 100755 (executable)
index 17d4ec7..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.0.7 (GNU/Linux)
-
-mQGiBD+dnTsRBACwnlz4AhctOLlVBAsq+RaU82nb5P3bD1YJJpsAce1Ckd2sBUOJ
-D11NUCqH8c7EctOquOZ5zTcWxHiWWbLyKQwUw2SUvnWa5SSbi8kI8q9MTPsPvhwt
-gMrQMLenMO+nsrxrSaG6XcD+ssfJNxC7NQVCQAj3pvvg9rKi3ygsM7CXHwCghgsq
-X6TOr55HE90DbEsoq3b/jjsD/i8aIZ6urUgrpAkQslcakXdJLKgSdwjRUgVZgvYZ
-b7kAx1iPq0t/AhB3NJw3zW4AAKJohGg3xj5K4V8PJEZrSIpoRYlF43Kqlfu2p5gh
-WT89SP4YAlWPeTqf0+dTYUYz3b144k2ZFOdRuXIRxunoYNAUr9oMrxBXbJ/eY+0U
-QX3pBACYzKizyY4JJgd0zFJmNkcdK9nzcm+btYFnYQo33w5GSE686UNr+9yiXt9t
-mPRvNEbj3u+xoAX8B/5k3aZ5NbUhV64/VcKlUdRIxNlFCG7I9KgxeHWAYwi7yqOG
-XM3T/v6o7GLdQEB0ChFqS7kUlqmwLV+C3QhlrFe/Cuk26i+Q6rQiRmVkb3JhIFBy
-b2plY3QgPGZlZG9yYUByZWRoYXQuY29tPohbBBMRAgAbBQI/nZ07BgsJCAcDAgMV
-AgMDFgIBAh4BAheAAAoJELRCadBPKm/S2PAAnRTlhorITphab+oxAHtbxZF9BVyD
-AJ9WOVaZUG53IWWIAXOGv3j/cmr3lohGBBMRAgAGBQI/nZ22AAoJECGRgM3bQqYO
-R5QAoIp1G+omVktq/snxpmz5UeHjlSYjAKCRr/ea/L7S7ZTxB18cf1TYfad1x4hG
-BBARAgAGBQI/ntjgAAoJECnVuiSN9W0FUSUAoJnrone4J0o1HMkRz+6g9KVuO2Fy
-AJ0XyebOzVmI9U5OyOfnNmYV0wnQcrkBDQQ/nZ08EAQAugOfLWJbKwMA9vg2mJU5
-94TZU0HRJkx/fqYhx0YxWWRpzplrEyvcDXuYcWi1Hwh0tD86T4fR5GV6joWiWClz
-D+Hwhhb6gcSdeSGlGLlZAvWYtFSHWiv+3LaI9w8Vtczl99Bh2WiMDNDDGw0RQg6Z
-aftldLSe4j1pffpFGQ8SuisAAwUEAKVxqLT7fC5xQ6oclcZ+PhoDlePQ1BiTS7tu
-GM07bFF4nNvY91LL7S31pooz3XbGSWP8jxzSv1Fw35YhSmWGOBOEXluqMbVQGJJ5
-m8fqJOjC0imbfeWgr/T7zLrJeiljDxvX+6TyawyWQngF6v1Hq6FRV0O0bOp9Npt5
-zqCbDGs/iEYEGBECAAYFAj+dnTwACgkQtEJp0E8qb9L//gCcDVYnDegNCOxDn1se
-dDwxw+0h8OcAn1CZHof15QqxnTwEnvwF2QeOI5dn
-=mJAx
------END PGP PUBLIC KEY BLOCK-----
index 622e6ce..33a04f9 100755 (executable)
 require_once 'plc_api.php';
 global $adm;
 
+// backwards compatibility with the old 4.2 API
+global $__PLC_API_VERSION;
+if ( ! method_exists ($adm,"GetInterfaces"))
+  $__PLC_API_VERSION = 4.2;
+else
+  $__PLC_API_VERSION = 4.3;
+
 // Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+if ($__PLC_API_VERSION==4.2)
+  $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+else
+  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
 if (!empty($interfaces)) {
   $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
   if (!empty($nodes)) {
diff --git a/PlanetLabConf/bwlimit.php b/PlanetLabConf/bwlimit.php
deleted file mode 100755 (executable)
index 850e864..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-//
-// Deprecated. Node Manager manages the node bandwidth limit.
-//
-// Mark Huang <mlhuang@cs.princeton.edu>
-// Copyright (C) 2006 The Trustees of Princeton University
-//
-// $Id$
-//
-
-// Get admin API handle
-require_once 'plc_api.php';
-global $adm;
-
-// Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($interfaces)) {
-  if ($interfaces[0]['bwlimit'] !== NULL) {
-    $rate = $interfaces[0]['bwlimit'];
-    if ($rate >= 1000000000 && ($rate % 1000000000) == 0) {
-      printf("%.0fgbit", ($rate / 1000000000.));
-    } elseif ($rate >= 1000000 && ($rate % 1000000) == 0) {
-      printf("%.0fmbit", ($rate / 1000000.));
-    } elseif ($rate >= 1000) {
-      printf("%.0fkbit", ($rate / 1000.));
-    } else {
-      printf("%.0fbit", $rate);
-    }
-  } else {
-    print "-1";
-  }
-}
-
-?>
diff --git a/PlanetLabConf/extensions.php b/PlanetLabConf/extensions.php
new file mode 100755 (executable)
index 0000000..53807bb
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+require_once 'plc_api.php';
+global $adm;
+
+if (isset($_REQUEST['node_id'])) {
+    $node_id = intval($_REQUEST['node_id']);
+    print $adm->GetNodeExtensions($node_id);
+}
+
+?>
+
index 6102a15..3d83056 100755 (executable)
@@ -11,6 +11,8 @@
 
 // Try the new plc_config.php file first
 include 'plc_config.php';
+require_once 'plc_api.php';
+global $adm;
 
 if (isset($_REQUEST['perl'])) {
   $shebang = '#!/usr/bin/perl';
@@ -31,21 +33,69 @@ if (isset($_REQUEST['perl'])) {
 }
 
 echo $shebang . "\n";
+$limit_view = True;
 
-foreach (array('PLC_API_HOST', 'PLC_API_PATH', 'PLC_API_PORT',
-              'PLC_WWW_HOST', 'PLC_BOOT_HOST', 'PLC_PLANETFLOW_HOST',
-              'PLC_NAME', 'PLC_SLICE_PREFIX',
-              'PLC_MAIL_SUPPORT_ADDRESS',
-              'PLC_MAIL_MOM_LIST_ADDRESS',
-              'PLC_MAIL_SLICE_ADDRESS')
-        as $name) {
-  if (defined($name)) {
-    // Perl, PHP, Python, and sh all support strong single quoting
-    $value = "'" . str_replace("'", "\\'", constant($name)) . "'";
-    printf($format, $name, $value);
-  }
+if (isset($_REQUEST['node_id']) ) {
+    $node_id = intval($_REQUEST['node_id']);
+} else {
+    $node_id = 0;
+}
+
+
+if ($node_id) {
+    $nodes = $adm->GetNodes($node_id);
+    if (!empty($nodes)) {
+        $node = $nodes[0];
+        $tags = $adm->GetNodeTags(array('node_id' => $node_id,
+                                        'tagname' => 'infrastructure'));
+        if (!empty($tags)) {
+            $tag = $tags[0];
+            if ( intval($tag['value']) == 1 ) {
+                $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+                if (!empty($interfaces)) {
+                    $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
+                    if (!empty($nodes)) {
+                        $node = $nodes[0];
+                        if ( $node['node_id'] == $node_id )
+                        {
+                            # NOTE: only provide complete view if 
+                            #     node exists
+                            #   node has infrastrucure tag
+                            #   infrastructure tag value == 1
+                            # Check that the requestor is the node.
+                            $limit_view = False;
+                        }
+                      }
+                }
+            }
+        }
+    }
 }
 
+if ( $limit_view ) {
+    $plc_constants = array('PLC_API_HOST', 'PLC_API_PATH', 'PLC_API_PORT',
+               'PLC_WWW_HOST', 'PLC_BOOT_HOST', 'PLC_PLANETFLOW_HOST',
+               'PLC_NAME', 'PLC_SLICE_PREFIX', 'PLC_MONITOR_HOST',
+               'PLC_MAIL_SUPPORT_ADDRESS',
+               'PLC_MAIL_MOM_LIST_ADDRESS',
+               'PLC_MAIL_SLICE_ADDRESS');
+} else {
+    $plc_constants = array();
+    $const = get_defined_constants(true);
+    foreach ( $const['user'] as $name => $v ){
+        if ( preg_match('/^PLC_/', $name) == 1 ){
+            $plc_constants[] = $name;
+        }        
+    }
+}
+
+foreach ($plc_constants as $name) {
+    if (defined($name)) {
+        // Perl, PHP, Python, and sh all support strong single quoting
+        $value = "'" . str_replace("'", "\\'", constant($name)) . "'";
+        printf($format, $name, $value);
+    }
+}
 printf($format, 'PLC_API_CA_SSL_CRT', "'/usr/boot/cacert.pem'");
 printf($format, 'PLC_ROOT_GPG_KEY_PUB', "'/usr/boot/pubring.gpg'");
 
diff --git a/PlanetLabConf/iptables-Internet2 b/PlanetLabConf/iptables-Internet2
deleted file mode 100644 (file)
index c1982cc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# Iptables rules for Internet2 (exempt) nodes.  Nodes sending traffic
-# to any of the IPs in the Internet2 ipset (hash) will end up the the
-# slice's exempt queue.  This supersedes the default config that lives
-# in svn/iptables/planetlab-config
-
-*filter
-:INPUT ACCEPT 
-:FORWARD ACCEPT 
-:OUTPUT ACCEPT 
-:BLACKLIST - 
-:LOGDROP - 
--A OUTPUT -j BLACKLIST
--A LOGDROP -j LOG
--A LOGDROP -j DROP
-COMMIT
-
-*mangle
-:PREROUTING ACCEPT 
-:INPUT ACCEPT 
-:FORWARD ACCEPT 
-:OUTPUT ACCEPT 
-:POSTROUTING ACCEPT 
--A INPUT -j MARK --copy-xid 0x0
--A POSTROUTING -j MARK --copy-xid 0x0
--A POSTROUTING -j CLASSIFY --set-class 0001:1000 --add-mark
--A POSTROUTING -m set --set Internet2 dst -j CLASSIFY --set-class 0001:2000 --add-mark
--A POSTROUTING -o eth0 -j ULOG --ulog-cprange 54 --ulog-qthreshold 16
-COMMIT
index 9bbd867..5fca766 100755 (executable)
@@ -1,8 +1,8 @@
 <?php
 //
-// Deprecated. Node Manager should manage keys.
-//
 // .ssh/authorized_keys generator
+// Node Manager should manage user keys.
+// This script remains current for special cases like root, site_admin, and monitor
 //
 // Basic usage:
 // keys.php?role=admin (all PlanetLab administrators)
@@ -24,7 +24,7 @@ $persons = array();
 $keys = array();
 
 if (!empty($_REQUEST['role'])) {
-  // XXX Implement API query filters
+  // API cannot filter on role_ids nor roles 
   // $persons = $adm->GetPersons(array('roles' => array($_REQUEST['role'])));
   $all_persons = $adm->GetPersons();
   foreach ($all_persons as $person) {
@@ -33,57 +33,56 @@ if (!empty($_REQUEST['role'])) {
     }
   }
 }
-if (isset($_REQUEST[PLC_SLICE_PREFIX . '_monitor'])) {
-  $user = $adm->GetPersons(array('first_name' => 'Site', 'last_name' => 'Assistant'));
-  if (!empty($user)) {
-    $persons[] = $user[0];
-  }
-}
 
-if (isset($_REQUEST['site_admin'])) {
-  // Look up the node
-  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
-  if (!empty($interfaces)) {
-    $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
-    if (!empty($nodes)) {
-      $node = $nodes[0];
-    }
+//
+// NOTE: this user is not used by the monitor for the moment.
+//
+/* // {ple,pl}_monitor user is created on the nodes by the monitor-runlevelagent init script. */
+/* if (isset($_REQUEST[PLC_SLICE_PREFIX . '_monitor'])) { */
+/*   $user = $adm->GetPersons(array('first_name' => 'Site', 'last_name' => 'Assistant')); */
+/*   if (!empty($user)) { */
+/*     $persons[] = $user[0]; */
+/*   } */
+/* } */
+
+if (isset($_REQUEST['site_admin']) && isset($_REQUEST['node_id'])) {
+  $nodes = $adm->GetNodes(array(intval($_REQUEST['node_id'])));
+  if (!empty($nodes)) {
+    $node = $nodes[0];
   }
   if (isset($node)) {
     // Look up the site
     $sites = $adm->GetSites(array($node['site_id']));
-    // Can't filter on roles so have to bruit force through entire userlist of site.
+    // Can't filter on roles so have to brute force through entire userlist of site.
     if ($sites && $sites[0]['person_ids']) {
       $all_persons = $adm->GetPersons($sites[0]['person_ids']);
-      foreach ($all_persons as $person) {
-           if ((in_array('pi', $person['roles']) || in_array('tech', $person['roles'])) && 
-        $person['enabled']) {
-          $persons[] = $person; 
-        }
-         }
+      if (!empty($all_persons))
+       foreach ($all_persons as $person)
+         if ((in_array('pi', $person['roles']) || in_array('tech', $person['roles'])) && $person['enabled']) 
+           $persons[] = $person; 
     }
   }
 }
 
-if (isset($_REQUEST['root'])) {
+if (isset($_REQUEST['root']))
   $keys[] = array('key' => file_get_contents(PLC_ROOT_SSH_KEY_PUB));
-}
 
 
 if (!empty($persons)) {
   $key_ids = array();
   foreach ($persons as $person) {
-       if ($person['key_ids']) {
-      $key_ids[] = $person['key_ids'][0];
-       }
+      if ($person['key_ids']) {
+          $person_key_ids = $person['key_ids'];
+          foreach ($person_key_ids as $person_key_id) {
+              $key_ids[] = $person_key_id;
+          }
+      }
   }
-  if (!empty($key_ids)) {
+  if (!empty($key_ids))
     $keys = $adm->GetKeys($key_ids);
-  }
 }
 
-foreach ($keys as $key) {
+foreach ($keys as $key)
   print $key['key']. "\n";
-}
 
 ?>
index ea3ce63..afd0d76 100755 (executable)
@@ -18,7 +18,13 @@ $default_name = "default";
 $file_name = $config_directory . $file_prefix . $default_name;
 
 // Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+
+// backwards compatibility with the old 4.2 API
+if ( ! method_exists ($adm,"GetInterfaces"))
+  $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+else
+  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+
 if (!empty($interfaces)) {
   $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
   if (!empty($nodes)) {
@@ -42,6 +48,10 @@ if (!empty($sites)) {
   $site_name= $sites[0]['name'];
   $mylat= $sites[0]['latitude'];
   $mylong= $sites[0]['longitude'];
+} else {
+  $site_name= "Unknown";
+  $mylat= 0;
+  $mylong= 0;
 }
 
 /* typical NTP settings */
index 386b7c9..80bfa5c 100755 (executable)
@@ -1,2 +1,3 @@
 server tock.fh-augsburg.de
-server tack.fh-augsburg.de
+server timeserver.rwth-aachen.de
+server clock.redhat.com
diff --git a/PlanetLabConf/ntp/ntp.conf.tp.pl b/PlanetLabConf/ntp/ntp.conf.tp.pl
new file mode 100755 (executable)
index 0000000..d628c27
--- /dev/null
@@ -0,0 +1,2 @@
+server ntp1.tp.pl
+server ntp2.tp.pl
diff --git a/PlanetLabConf/ntp/ntp.conf.tpnet.pl b/PlanetLabConf/ntp/ntp.conf.tpnet.pl
new file mode 100755 (executable)
index 0000000..d628c27
--- /dev/null
@@ -0,0 +1,2 @@
+server ntp1.tp.pl
+server ntp2.tp.pl
diff --git a/PlanetLabConf/ntptickers.php b/PlanetLabConf/ntptickers.php
deleted file mode 100755 (executable)
index 263fecb..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-require_once('setup_plconf.php');
-
-/* Look for config file */
-
-$config_directory= "/var/www/html/PlanetLabConf/ntp/";
-$file_prefix= "ntp.conf.";
-$hostname_bits = explode('.', $hostname);
-$chunk_counter = sizeof ($hostname_bits);
-$compare_chunk = $hostname ;
-$found_file = 0;
-$default_name = "default";
-
-/* look for the host specific overrides */
-$file_name = $config_directory . "host/". $file_prefix . $compare_chunk ;
-if (is_file($file_name)) {
-       $chunk_counter = 0;
-       $found_file = 1;
-}
-
-/* look for the domain specific overrides */
-while ($chunk_counter > 0) {
-       $file_name = $config_directory . $file_prefix . $compare_chunk ;
-       if (is_file($file_name)) {
-               $chunk_counter = 0;
-               $found_file = 1;
-       }
-       else {
-               array_shift($hostname_bits);
-               $compare_chunk = implode('.',$hostname_bits);
-               $chunk_counter--;
-       }
-}
-
-if ($found_file and is_readable($file_name)) {
-       $lines=file($file_name);
-} 
-else {
-       $file_name = $config_directory . $file_prefix . $default_name ;
-       $lines=file($file_name);
-} 
-
-foreach ($lines as $line_num => $line) {
-       $line=rtrim($line);
-       $elements=explode(' ',$line);
-       if ($elements[0] == "server") {
-               print ("$elements[1]\n");
-       }
-}
-
-?>
-
index d2b893c..4431aca 100755 (executable)
@@ -18,7 +18,17 @@ require_once 'plc_api.php';
 global $adm;
 
 // Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+// backwards compatibility with the old 4.2 API
+global $__PLC_API_VERSION;
+if ( ! method_exists ($adm,"GetInterfaces"))
+  $__PLC_API_VERSION = 4.2;
+else
+  $__PLC_API_VERSION = 4.3;
+if ($__PLC_API_VERSION==4.2)
+  $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+else
+  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+
 if (!empty($interfaces)) {
   $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
   if (!empty($nodes)) {
@@ -30,7 +40,10 @@ if (!isset($node)) {
   exit();
 }
 
-$interfaces = $adm->GetInterfaces($node['interface_ids']);
+if ($__PLC_API_VERSION==4.2)
+  $interfaces = $adm->GetInterfaces($node['nodenetwork_ids']);
+else
+  $interfaces = $adm->GetInterfaces($node['interface_ids']);
 
 foreach ($interfaces as $interface) {
   // XXX PL2896: need interfaces.device
diff --git a/PlanetLabConf/sfa_config.php b/PlanetLabConf/sfa_config.php
new file mode 100755 (executable)
index 0000000..851128e
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+//
+// SFA Component Manager configuration   
+//
+// $Id:
+//
+
+$config_directory = "/etc/sfa/";
+$default_name = "sfa_component_config";
+$file_name = $config_directory . $default_name;
+readfile($file_name); 
+exit();
+
+?>
diff --git a/PlanetLabConf/sudoers b/PlanetLabConf/sudoers
deleted file mode 100755 (executable)
index e29525a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-# -----------------------------------------------------------------
-# We're assuming that ssh authentication has already been used, this
-# is more risky than I'm comfortable with, but it saves the problem 
-# of managing a separate password file.
-# -----------------------------------------------------------------
-Defaults       !authenticate
-
-# -----------------------------------------------------------------
-# No surpise... root has universal access
-# -----------------------------------------------------------------
-root           ALL = (ALL) ALL
-
-# -----------------------------------------------------------------
-# SITE_CMDS are those available to local site administrators
-# -----------------------------------------------------------------
-Cmnd_Alias     SITE_CMDS =     /usr/sbin/vps, \
-                               /usr/sbin/vpstree, \
-                               /usr/sbin/vtop, \
-                               /bin/ps, \
-                               /usr/bin/pstree, \
-                               /usr/bin/top, \
-                               /usr/sbin/tcpdump, \
-                               /usr/bin/pfgrep, \
-                               /usr/local/planetlab/bin/pl-catlogs, \
-                               /sbin/halt, \
-                               /sbin/reboot, \
-                               /sbin/shutdown, \
-                               /usr/bin/passwd -d site_admin, \
-                               /usr/bin/passwd site_admin, \
-                               /bin/more /var/log/messages, \
-                               /bin/more /var/log/nm
-
-# -----------------------------------------------------------------
-# Site Admins -- accounts with admin privileges on the local nodes
-# -----------------------------------------------------------------
-site_admin     ALL = SITE_CMDS
diff --git a/PlanetLabConf/sysctl-ip_forward.php b/PlanetLabConf/sysctl-ip_forward.php
new file mode 100755 (executable)
index 0000000..1cc7e5b
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+//
+// $Id$
+//
+
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+$ip_forward = 0;
+
+// Look up the node
+// backwards compatibility with the old 4.2 API
+global $__PLC_API_VERSION;
+if ( ! method_exists ($adm,"GetInterfaces"))
+  $__PLC_API_VERSION = 4.2;
+else
+  $__PLC_API_VERSION = 4.3;
+
+if ($__PLC_API_VERSION==4.2)
+  $interfaces = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+else
+  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
+
+if (!empty($interfaces)) {
+  $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
+  if (!empty($nodes)) {
+    $node = $nodes[0];
+    if ($__PLC_API_VERSION==4.2)
+      $interfaces = $adm->GetInterfaces($node['nodenetwork_ids']);
+    else
+      $interfaces = $adm->GetInterfaces($node['interface_ids']);
+
+    foreach ($interfaces as $interface) {
+      // Nodes with proxy socket interfaces need to be able to forward
+      // between the fake proxy0 interface and the real interface.
+      if ($interface['method'] == 'proxy') {
+       $ip_forward = 1;
+       break;
+      }
+    }
+  }
+}
+
+?>
+
+# $Id$
+#
+# sysctl configuration file to optionally enable/disable IP forwarding
+#
+# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
+# sysctl.conf(5) for more details.
+#
+# This file is generated by NodeManager Configuration Files... 
+# do not manually edit
+#
+
+# Controls IP packet forwarding
+net.ipv4.ip_forward = <?php echo $ip_forward; ?>
diff --git a/PlanetLabConf/sysctl.conf b/PlanetLabConf/sysctl.conf
new file mode 100644 (file)
index 0000000..ce6f512
--- /dev/null
@@ -0,0 +1,30 @@
+# Controls the System Request debugging functionality of the kernel
+kernel.sysrq = 0
+
+# Controls whether core dumps will append the PID to the core filename.
+# Useful for debugging multi-threaded applications.
+kernel.core_uses_pid = 1
+
+# Controls source route verification
+net.ipv4.conf.default.rp_filter = 1
+
+# TCP window scaling and broken routers
+net.ipv4.tcp_moderate_rcvbuf=0
+net.ipv4.tcp_default_win_scale=0
+net.ipv4.tcp_window_scaling=1
+
+# Mark only out of window RST segments as INVALID. This setting, among
+# other things, allows data to be sent with SYN packets.
+net.ipv4.netfilter.ip_conntrack_tcp_be_liberal=1
+
+# Fixes dst cache overflow bug
+net.ipv4.route.max_size=262144
+
+net.ipv4.tcp_congestion_control = cubic
+net.ipv4.tcp_moderate_rcvbuf = 0
+net.core.rmem_max = 131071
+net.core.wmem_max = 131071
+net.ipv4.tcp_rmem = 4096 87380 4194304
+net.ipv4.tcp_wmem = 4096 16384 4194304
+net.netfilter.nf_conntrack_icmp_timeout = 60
+
diff --git a/PlanetLabConf/sysctl.php b/PlanetLabConf/sysctl.php
deleted file mode 100755 (executable)
index 127362e..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-//
-// /etc/sysctl.conf generator
-//
-// Mark Huang <mlhuang@cs.princeton.edu>
-// Copyright (C) 2006 The Trustees of Princeton University
-//
-// $Id$
-//
-
-// Get admin API handle
-require_once 'plc_api.php';
-global $adm;
-
-$ip_forward = 0;
-
-// Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($interfaces)) {
-  $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
-  if (!empty($nodes)) {
-    $node = $nodes[0];
-    $interfaces = $adm->GetInterfaces($node['interface_ids']);
-    foreach ($interfaces as $interface) {
-      // Nodes with proxy socket interfaces need to be able to forward
-      // between the fake proxy0 interface and the real interface.
-      if ($interface['method'] == 'proxy') {
-       $ip_forward = 1;
-       break;
-      }
-    }
-  }
-}
-
-?>
-
-# Kernel sysctl configuration file for Red Hat Linux
-#
-# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
-# sysctl.conf(5) for more details.
-
-# $Id$
-
-# Controls IP packet forwarding
-net.ipv4.ip_forward = <?php echo $ip_forward; ?>
-
-# Controls source route verification
-net.ipv4.conf.default.rp_filter = 1
-
-# Controls the System Request debugging functionality of the kernel
-kernel.sysrq = 0
-
-# Controls whether core dumps will append the PID to the core filename.
-# Useful for debugging multi-threaded applications.
-kernel.core_uses_pid = 1
-
-# TCP window scaling and broken routers
-net.ipv4.tcp_moderate_rcvbuf=0
-net.ipv4.tcp_default_win_scale=0
-net.ipv4.tcp_window_scaling=0
-
-# Mark only out of window RST segments as INVALID. This setting, among
-# other things, allows data to be sent with SYN packets.
-net.ipv4.netfilter.ip_conntrack_tcp_be_liberal=1
-
-# Fixes dst cache overflow bug
-net.ipv4.route.max_size=262144
diff --git a/PlanetLabConf/yum.conf.php b/PlanetLabConf/yum.conf.php
deleted file mode 100755 (executable)
index 9eaf430..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-<?php
-//
-// /etc/yum.conf for production nodes
-//
-// Mark Huang <mlhuang@cs.princeton.edu>
-// Copyright (C) 2004-2006 The Trustees of Princeton University
-//
-// $Id$
-//
-
-// For PLC_NAME and PLC_BOOT_HOST
-include('plc_config.php');
-
-$PLC_NAME = PLC_NAME;
-$PLC_BOOT_HOST = PLC_BOOT_HOST;
-
-$oldrepos = array(array('FedoraCore2Base', 'Fedora Core 2 Base', 'stock-fc2'),
-              array('FedoraCore2Updates', 'Fedora Core 2 Updates', 'updates-fc2'),
-              array('ThirdParty', 'Third Party RPMS', '3rdparty'));
-
-$repos = array(array('ThirdParty', 'Third Party RPMS', '3rdparty'));
-
-
-if (isset($_REQUEST['alpha'])) {
-  $repos[] = array('PlanetLabAlpha', 'PlanetLab Alpha RPMS', 'planetlab-alpha');
-} elseif (isset($_REQUEST['beta'])) {
-  $repos[] = array('PlanetLabBeta', 'PlanetLab Beta RPMS', 'planetlab-beta');
-} elseif (isset($_REQUEST['rollout'])) {
-  $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab-rollout');
-} else {
-  $repos[] = array('PlanetLab', 'PlanetLab RPMS', 'planetlab');
-}
-
-if (isset($_REQUEST['gpgcheck'])) {
-  $gpgcheck = $_REQUEST['gpgcheck'];
-} else {
-  $gpgcheck = 0;
-}
-
-// Requesting a mirror list. Yum bombs out completely if a repository
-// is (even temporarily) unavailable, so if CoBlitz is down, provide a
-// few more options. Make sure that gpgcheck remains enabled.  Last
-// chance option is ourselves so that yum never fails.
-if (isset($_REQUEST['mirrorlist']) &&
-    isset($_REQUEST['repo']) &&
-    isset($_REQUEST['releasever'])) {
-  $mirrors = array("http://coblitz.codeen.org/coblitz.planet-lab.org/pub/fedora/linux",
-                  "http://fedora.gtlib.cc.gatech.edu/pub/fedora.redhat/linux",
-                  "http://download.fedoraproject.org/pub/fedora/linux",
-                  "http://mirrors.kernel.org/fedora");
-                  #"ftp://rpmfind.net/linux/fedora",  still uses the old style of directory hierarchy
-  $releasever = $_REQUEST['releasever'];
-  switch ($_REQUEST['repo']) {
-  case "base":
-       if ( intval($releasever) >= 7 )
-       {
-               foreach ($mirrors as $mirror) {
-                 echo "$mirror/releases/$releasever/Everything/\$ARCH/os/\n";
-               }
-
-       } else {
-               foreach ($mirrors as $mirror) {
-                 echo "$mirror/core/$releasever/\$ARCH/os/\n";
-               }
-       }
-    break;
-  case "updates":
-       if ( intval($releasever) >= 7 )
-       {
-               foreach ($mirrors as $mirror) {
-                 echo "$mirror/updates/$releasever/\$ARCH/\n";
-               }
-
-       } else {
-               foreach ($mirrors as $mirror) {
-                 echo "$mirror/core/updates/$releasever/\$ARCH/\n";
-               }
-       }
-    break;
-  }
-
-  // Always list ourselves last
-  echo "https://$PLC_BOOT_HOST/install-rpms/planetlab/\n";
-  exit;
-}
-
-// Requesting yum.conf. See above for the mirrorlist definition.
-echo <<<EOF
-[main]
-# Do not scan /etc/yum.repos.d/
-reposdir=/dev/null
-cachedir=/var/cache/yum
-debuglevel=2
-logfile=/var/log/yum.log
-pkgpolicy=newest
-gpgcheck=$gpgcheck
-
-[base]
-name=Fedora Core \$releasever - \$basearch - Base
-mirrorlist=https://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=base&releasever=\$releasever
-gpgcheck=$gpgcheck
-# PlanetLab builds its own versions of these tools
-exclude=iptables kernel kernel kernel-devel kernel-smp kernel-smp-devel kernel-xen0 kernel-xen0-devel kernel-xenU kernel-xenU-devel mysql ulogd
-
-[updates]
-name=Fedora Core \$releasever - \$basearch - Released Updates
-mirrorlist=https://$PLC_BOOT_HOST/PlanetLabConf/yum.conf.php?mirrorlist&repo=updates&releasever=\$releasever
-gpgcheck=$gpgcheck
-# PlanetLab builds its own versions of these tools
-exclude=iptables kernel kernel kernel-devel kernel-smp kernel-smp-devel kernel-xen0 kernel-xen0-devel kernel-xenU kernel-xenU-devel mysql ulogd
-
-EOF;
-
-// Figure out which repositories we actually have on this
-// machine. MyPLC installations, for instance, generally only have
-// PlanetLab RPMS installed.
-foreach ($repos as $repo) {
-  $id = $repo[0];
-  $name = $repo[1] . " -- " . "$PLC_NAME Central";
-  $dir = "/install-rpms/" . $repo[2];
-  $baseurl = "https://$PLC_BOOT_HOST" . $dir . "/";
-
-  if (is_dir(realpath($_SERVER['DOCUMENT_ROOT'] . $dir))) {
-    echo <<<EOF
-[$id]
-name=$name
-baseurl=$baseurl
-gpgcheck=$gpgcheck
-
-
-EOF;
-  }
-}
-
-?>
diff --git a/boot/getnodeid.php b/boot/getnodeid.php
deleted file mode 100755 (executable)
index fdbf9dd..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-//
-// Returns node ID of requestor
-//
-// Mark Huang <mlhuang@cs.princeton.edu>
-// Copyright (C) 2006 The Trustees of Princeton University
-//
-// $Id$ $
-//
-
-// Get admin API handle
-require_once 'plc_api.php';
-global $adm;
-
-if (!empty($_REQUEST['mac_addr'])) {
-  $mac_lower = strtolower(trim($_REQUEST['mac_addr']));
-  $mac_upper = strtoupper(trim($_REQUEST['mac_addr']));
-  $interfaces = $adm->GetInterfaces(array('mac' => array($mac_lower, $mac_upper)));
-} else {
-  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
-}
-
-if (!empty($interfaces)) {
-  print $interfaces[0]['node_id'];
-} else {
-  print "-1";
-}
-
-?>
diff --git a/boot/index.php b/boot/index.php
deleted file mode 100755 (executable)
index 9afe279..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-//
-// Returns node boot script
-//
-// Mark Huang <mlhuang@cs.princeton.edu>
-// Copyright (C) 2006 The Trustees of Princeton University
-//
-// $Id$ $
-//
-
-// Get admin API handle
-require_once 'plc_api.php';
-global $adm;
-
-// Default bootmanager
-$bootmanager = "bootmanager.sh.sgn";
-
-// Look up the node
-$interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($interfaces)) {
-  $nodes = $adm->GetNodes(array($interfaces[0]['node_id']));
-  if (!empty($nodes)) {
-    $node = $nodes[0];
-  }
-}
-
-if (isset($node)) {
-  // Allow very old nodes that do not have a node key in their
-  // configuration files to use their "boot nonce" instead. The boot
-  // nonce is a random value generated by the node itself and POSTed
-  // by the Boot CD when it requests the Boot Manager. This is
-  // obviously not very secure, so we only allow it to be used if the
-  // requestor IP is the same as the IP address we have on record for
-  // the node.
-
-  // 3.x CDs post 'version', 2.x CDs post 'id'.
-  if (!empty($_REQUEST['version'])) {
-    $version = trim($_REQUEST['version']);
-  } elseif (!empty($_REQUEST['id'])) {
-    $version = trim($_REQUEST['id']);
-  } else {
-    $version = "2.0";
-  }
-
-  if (empty($node['key']) && !empty($_REQUEST['nonce'])) {
-    // 3.x CDs post the boot nonce in ASCII hex. 2.x CDs post it in binary.
-    if (strstr($version, "2.0") === FALSE) {
-      // 3.x CDs post a trailing newline...sigh
-      $nonce = trim($_REQUEST['nonce']);
-    } else {
-      $nonce = bin2hex($_REQUEST['nonce']);
-    }
-    $adm->UpdateNode($node['node_id'], array('boot_nonce' => $nonce));
-  }
-
-  // Custom bootmanager for the node, e.g.
-  // planetlab-1.cs.princeton.edu_bootmanager.sh.sgn
-  $bootmanagers = array(strtolower($node['hostname']) . "_" . $bootmanager);
-
-  // Custom bootmanager for the node group, e.g.
-  // alpha_bootmanager.sh.sgn
-  if (!empty($node['nodegroup_ids'])) {
-    $nodegroups = $adm->GetNodeGroups($node['nodegroup_ids']);
-    foreach ($nodegroups as $nodegroup) {
-      $bootmanagers[] = strtolower($nodegroup['groupname']) . "_" . $bootmanager;
-    }
-  }
-}
-
-// Default bootmanager
-$bootmanagers[] = $bootmanager;
-
-foreach ($bootmanagers as $bootmanager) {
-  if (file_exists($bootmanager)) {
-    readfile($bootmanager);
-    exit();
-  }
-}
-
-?>
diff --git a/boot/uudecode.gz b/boot/uudecode.gz
deleted file mode 100755 (executable)
index 040c34f..0000000
Binary files a/boot/uudecode.gz and /dev/null differ
diff --git a/db-config.d/030-conf_files_iptables b/db-config.d/030-conf_files_iptables
new file mode 100644 (file)
index 0000000..66c155d
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+# iptables
+    # Firewall configuration
+    {'enabled': True,
+     'source': 'PlanetLabConf/blacklist.php',
+     'dest': '/etc/planetlab/blacklist',
+     'file_permissions': '600',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/sbin/iptables-restore --noflush < /etc/planetlab/blacklist',
+     'error_cmd': '',
+     'ignore_cmd_errors': True,
+     'always_update': False},
+    
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_kernel b/db-config.d/030-conf_files_kernel
new file mode 100644 (file)
index 0000000..8f9bb37
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+# linux-2.6
+    # Kernel sysctl parameters
+    {'enabled': True,
+     'source': 'PlanetLabConf/sysctl.conf',
+     'dest': '/etc/sysctl.conf',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/sbin/sysctl -e -p /etc/sysctl.conf',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_ping_of_death b/db-config.d/030-conf_files_ping_of_death
new file mode 100644 (file)
index 0000000..79da0e4
--- /dev/null
@@ -0,0 +1,26 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+# PoD
+    # Ping of death configuration
+    # the 'restart' postcommand doesn't work, b/c the pod script doesn't support it.
+    {'enabled': True,
+     'source': 'PlanetLabConf/ipod.conf.php',
+     'dest': '/etc/ipod.conf',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/etc/init.d/pod start',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_plc_config b/db-config.d/030-conf_files_plc_config
new file mode 100644 (file)
index 0000000..da1eb49
--- /dev/null
@@ -0,0 +1,57 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+    # PLC configuration
+    {'enabled': True,
+     'source': 'PlanetLabConf/get_plc_config.php',
+     'dest': '/etc/planetlab/plc_config',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    {'enabled': True,
+     'source': 'PlanetLabConf/get_plc_config.php?python',
+     'dest': '/etc/planetlab/plc_config.py',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    {'enabled': True,
+     'source': 'PlanetLabConf/get_plc_config.php?perl',
+     'dest': '/etc/planetlab/plc_config.pl',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    {'enabled': True,
+     'source': 'PlanetLabConf/get_plc_config.php?php',
+     'dest': '/etc/planetlab/php/plc_config.php',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_security b/db-config.d/030-conf_files_security
new file mode 100644 (file)
index 0000000..22d909d
--- /dev/null
@@ -0,0 +1,64 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+    # SSH server configuration
+    # keys for root and site_admin are now handled as part of the specialaccounts NodeManager plugin
+    {'enabled': True,
+     'source': 'PlanetLabConf/sshd_config',
+     'dest': '/etc/ssh/sshd_config',
+     'file_permissions': '600',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/etc/init.d/sshd restart',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    # sudo configuration
+    {'enabled': True,
+     'source': 'PlanetLabConf/sudoers.php',
+     'dest': '/etc/sudoers',
+     'file_permissions': '440',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/usr/sbin/visudo -c',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+
+    # GPG signing keys
+    {'enabled': True,
+     'source': 'PlanetLabConf/get_gpg_key.php',
+     'dest': '/etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': 'rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    # Proxy ARP setup
+    {'enabled': True,
+     'source': 'PlanetLabConf/proxies.php',
+     'dest': '/etc/planetlab/proxies',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_services b/db-config.d/030-conf_files_services
new file mode 100644 (file)
index 0000000..ef027d4
--- /dev/null
@@ -0,0 +1,97 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+    # NTP configuration
+    {'enabled': True,
+     'source': 'PlanetLabConf/ntp.conf.php',
+     'dest': '/etc/ntp.conf',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/etc/rc.d/init.d/ntpd restart',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    {'enabled': True,
+     'source': 'PlanetLabConf/ntp/step-tickers.php',
+     'dest': '/etc/ntp/step-tickers',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '/etc/rc.d/init.d/ntpd restart',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    # Log rotation configuration
+    {'enabled': True,
+     'source': 'PlanetLabConf/logrotate.conf',
+     'dest': '/etc/logrotate.conf',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    # updatedb/locate nightly cron job
+    {'enabled': True,
+     'source': 'PlanetLabConf/slocate.cron',
+     'dest': '/etc/cron.daily/slocate.cron',
+     'file_permissions': '755',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    # Sendmail configuration
+    {'enabled': True,
+     'source': 'PlanetLabConf/sendmail.mc',
+     'dest': '/etc/mail/sendmail.mc',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    {'enabled': True,
+     'source': 'PlanetLabConf/sendmail.cf',
+     'dest': '/etc/mail/sendmail.cf',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': 'service sendmail restart',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+    
+    # /etc/issue
+    {'enabled': True,
+     'source': 'PlanetLabConf/issue.php',
+     'dest': '/etc/issue',
+     'file_permissions': '644',
+     'file_owner': 'root',
+     'file_group': 'root',
+     'preinstall_cmd': '',
+     'postinstall_cmd': '',
+     'error_cmd': '',
+     'ignore_cmd_errors': False,
+     'always_update': False},
+
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
diff --git a/db-config.d/030-conf_files_sfa b/db-config.d/030-conf_files_sfa
new file mode 100644 (file)
index 0000000..75871a8
--- /dev/null
@@ -0,0 +1,25 @@
+# -*-python-*-
+# $Id: 030-conf_files 16642 2010-01-18 17:14:40Z thierry $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/030-conf_files $
+#################### conf files
+
+conf_files = [
+
+# sfa
+    # /etc/sfa/sfa_config
+    {'enabled': True,
+     'source': u'PlanetLabConf/sfa_config.php', 
+     'dest': u'/etc/sfa/sfa_config.py', 
+     'file_permissions': u'644', 
+     'file_owner': u'root', 
+     'file_group': u'root',
+     'preinstall_cmd': u'mkdir /etc/sfa', 
+     'postinstall_cmd': '', 
+     'error_cmd': '', 
+     'ignore_cmd_errors': False, 
+     'always_update': False}
+
+    ]
+
+for conf_file in conf_files:
+       SetConfFile(conf_file)
index 52eef27..1586dfe 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $Id: PLCWWW.spec 7881 2008-01-22 14:45:22Z thierry $
+# $Id$
 #
 %define url $URL: svn+ssh://thierry@svn.planet-lab.org/svn/WWW/trunk/PLCWWW.spec $
 
@@ -17,7 +17,8 @@ License: PlanetLab
 Group: System Environment/Daemons
 Source0: %{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildArch: noarch
+# cannot do this as of f12
+#BuildArch: noarch
 
 Vendor: PlanetLab
 Packager: PlanetLab Central <support@planet-lab.org>
@@ -26,7 +27,7 @@ URL: %(echo %{url} | cut -d ' ' -f 2)
 
 # We use set everywhere
 Requires: php >= 5.0
-Requires: PLCAPI >= 5.0
+Requires: PLCAPI >= 4.3
 
 %description
 
@@ -40,30 +41,75 @@ reasons these scripts get installed in /var/www/html/PlanetLabConf.
 %setup -q
 
 %build
-echo "There is no build stage for this component."
-echo "All files just need to be installed as is from the codebase."
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
 echo "* nodeconfig: Installing PlanetLabConf pages"
 
-for dir in boot PlanetLabConf PLCAPI ; do
+for dir in PlanetLabConf PLCAPI ; do
     mkdir -p $RPM_BUILD_ROOT/var/www/html/$dir
     rsync -a --exclude .svn ./$dir/ $RPM_BUILD_ROOT/var/www/html/$dir/
 done
 
+# Install db-config.d files
+echo "* Installing db-config.d files"
+mkdir -p ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
+cp db-config.d/* ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d
+chmod 444 ${RPM_BUILD_ROOT}/etc/planetlab/db-config.d/*
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+
 %files
 %defattr(-,root,root,-)
-/var/www/html/boot
 /var/www/html/PlanetLabConf
 /var/www/html/PLCAPI
+/etc/planetlab/db-config.d
 
 %changelog
-* Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-5.0-1
+* Fri Jan 29 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-5.0-1
+- first working version of 5.0:
+- pld.c/, db-config.d/ and nodeconfig/ scripts should now sit in the module they belong to
+- the yum/ and boot/ subdirs have moved away from here
+
+* Wed Dec 23 2009 Marc Fiuczynski <mef@cs.princeton.edu> - nodeconfig-4.3-7
+- - decompose PlanetLabConf/sysctl.php into sysctl.conf and
+- sysctl-ip_forward.php. This is in prep of phasing out the latter
+- altogether, as enabling ip_forwarding should be something that is
+- managed by NM.
+- - PlanetLabConf/ntptickers.php migrated PlanetLabConf/ntp/step-tickers.php
+- - Added sfa_config.php
+- - updated ntp server set for .de (german) nodes.
+- - f12 related changes from Thierry/Baris
+
+* Sun Nov 22 2009 Marc Fiuczynski <mef@cs.princeton.edu> - nodeconfig-4.3-6
+- For all MyPLC nodes deployed at Polish Telecom (PLC, PLE and CoBlitz),
+- use the TP local NTP servers.
+
+* Mon Sep 07 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-4.3-5
+- new script for updating the exentions set
+- keys.php reviewed
+- cleanup useless scripts
+
+* Sat Jul 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - nodeconfig-4.3-4
+- add two views to the PLC config data, limited and unlimited.
+- unlimited view reports all values.  Requires the 'infrastructure=1' tag and
+- that the call originates from the node.
+
+* Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-4.3-3
+- changes to sysctl.conf for co* relating to tcp window scaling
+
+* Tue Mar 24 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-4.3-2
+- renumbered 4.3
+- new script upload-bmlog.php
+- attempts to ship decent yum configs for stock repos to nodes
+- cleanup old stuff
+- attempts to be 4.2 compatible
+
+* Wed Sep 10 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-4.3-1
 - reflects new names from the data model
 
 * Tue Apr 22 2008 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - nodeconfig-4.2-4
@@ -78,4 +124,4 @@ rm -rf $RPM_BUILD_ROOT
 - former content has moved down into PlanetLabConf
 
 
-%define module_current_branch 4.2
+%define module_current_branch 4.3