Branch 5.0 for module nodeconfig created (as new trunk) from tag nodeconfig-4.3-7 nodeconfig-5.0-0
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 25 Jan 2010 14:42:17 +0000 (14:42 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 25 Jan 2010 14:42:17 +0000 (14:42 +0000)
50 files changed:
Makefile [new file with mode: 0644]
PlanetLabConf/RPM-GPG-KEY-fedora [deleted file]
PlanetLabConf/RootResources/pl_conf.py [deleted file]
PlanetLabConf/RootResources/pl_netflow.py [deleted file]
PlanetLabConf/RootResources/plc_slice_pool.php [deleted file]
PlanetLabConf/blacklist.php
PlanetLabConf/bwlimit.php [deleted file]
PlanetLabConf/extensions.php [new file with mode: 0755]
PlanetLabConf/get_plc_config.php
PlanetLabConf/getupdatesxml.php [deleted file]
PlanetLabConf/iptables [deleted file]
PlanetLabConf/keys.php
PlanetLabConf/ntp.conf.php
PlanetLabConf/ntp/ntp.conf.au
PlanetLabConf/ntp/ntp.conf.ch
PlanetLabConf/ntp/ntp.conf.cn
PlanetLabConf/ntp/ntp.conf.de
PlanetLabConf/ntp/ntp.conf.dk
PlanetLabConf/ntp/ntp.conf.eurecom.fr
PlanetLabConf/ntp/ntp.conf.fr
PlanetLabConf/ntp/ntp.conf.ipv6.lip6.fr
PlanetLabConf/ntp/ntp.conf.tp.pl [new file with mode: 0755]
PlanetLabConf/ntp/ntp.conf.tpnet.pl [new file with mode: 0755]
PlanetLabConf/ntp/step-tickers.php
PlanetLabConf/ntptickers.php [deleted file]
PlanetLabConf/propd.conf [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
boot/index.php
boot/upload-bmlog.php [new file with mode: 0755]
nodeconfig.spec
yum/centos5/yum.conf [new file with mode: 0644]
yum/centos5/yum.myplc.d/CentOS-Base.repo.in [new file with mode: 0644]
yum/centos5/yum.myplc.d/epel.repo.in [new file with mode: 0644]
yum/f10/yum.conf [new file with mode: 0644]
yum/f10/yum.myplc.d/fedora-updates.repo.in [new file with mode: 0644]
yum/f10/yum.myplc.d/fedora.repo.in [new file with mode: 0644]
yum/f12/yum.conf [new file with mode: 0644]
yum/f12/yum.myplc.d/fedora-updates.repo.in [new file with mode: 0644]
yum/f12/yum.myplc.d/fedora.repo.in [new file with mode: 0644]
yum/f8/yum.conf [new file with mode: 0644]
yum/f8/yum.myplc.d/fedora-updates.repo.in [new file with mode: 0644]
yum/f8/yum.myplc.d/fedora.repo.in [new file with mode: 0644]
yum/myplc.repo.php [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..dce5ef7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+### $Id$
+#
+# how to push a working directoy to a running plc
+#
+
+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
+PLCSSH:=root@$(PLCHOST):/vservers/$(VSERVER)
+endif
+endif
+
+LOCAL_RSYNC_EXCLUDES   := --exclude '*.pyc' 
+RSYNC_EXCLUDES         := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
+RSYNC_COND_DRY_RUN     := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
+RSYNC                  := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
+
+sync:
+ifeq (,$(PLCSSH))
+       echo "sync: You must define PLCHOST and VSERVER on the command line"
+       echo " e.g. make sync PLCHOST=private.one-lab.org VSERVER=myplc01" ; exit 1
+else
+       +$(RSYNC) PlanetLabConf boot PLCAPI $(PLCSSH)/var/www/html/
+       ssh root@$(PLCHOST) vserver $(VSERVER) exec apachectl graceful
+endif
+
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-----
diff --git a/PlanetLabConf/RootResources/pl_conf.py b/PlanetLabConf/RootResources/pl_conf.py
deleted file mode 100755 (executable)
index 0a156df..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# RootResources/pl_conf
-
-PL_CONF_VINIT = """#!/bin/sh
-
-# crond needs syslogd running
-/sbin/chkconfig syslog on
-
-# use crond to check for updates
-/sbin/chkconfig crond on
-
-cat <<EOF >/etc/cron.daily/yum-upgrade
-#!/bin/sh
-
-rm -f /var/lib/rpm/__db*
-yum -y upgrade
-EOF
-chmod a+x /etc/cron.daily/yum-upgrade
-
-PACKAGE=sidewinder-PlanetLab-SCS
-rm -f /var/lib/rpm/__db*
-yum -y install $PACKAGE
-"""
-
-try:
-    pl_conf = RootSlice(nm_vserver_flags = "static",
-                        nm_cpu_share = 32,
-                        nm_initscript = PL_CONF_VINIT)
-except:
-    pass
diff --git a/PlanetLabConf/RootResources/pl_netflow.py b/PlanetLabConf/RootResources/pl_netflow.py
deleted file mode 100755 (executable)
index 5d5a4dd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# RootResources/pl_netflow
-
-try:
-    pl_netflow = RootSlice(nm_vserver_flags = "syncstart",
-                           nm_cpu_share = 32)
-except:
-    pass
diff --git a/PlanetLabConf/RootResources/plc_slice_pool.php b/PlanetLabConf/RootResources/plc_slice_pool.php
deleted file mode 100755 (executable)
index a61a656..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-include('plc_config.php');
-?>
-# RootResources/plc_slice_pool
-
-SA_HOST = "<?php print(PLC_BOOT_HOST); ?>"
-SA_URL = SA_HOST + "/xml/"
-CACERT_PATH = "/mnt/cdrom/bootme/cacert/%s/cacert.pem" % SA_HOST
-
-plc_slice_pool = RootPool(slice = "pl_conf",
-                         plc_sa_prefix = "pl",
-                         plc_sa_server = SA_URL,
-                         plc_sa_cacert = CACERT_PATH,
-                         nm_pool_child_type = "VServerSlice",
-                         nm_cpu_share = RES_INF,
-                         nm_net_avg_rate = RES_INF,
-                         nm_net_min_rate = RES_INF,
-                         nm_net_max_rate = RES_INF,
-                         nm_net_exempt_avg_rate = RES_INF,
-                         nm_net_exempt_min_rate = RES_INF,
-                         nm_net_exempt_max_rate = RES_INF,
-                         nm_disk_quota = RES_INF)
index 8966f6d..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
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
+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];
   }
diff --git a/PlanetLabConf/bwlimit.php b/PlanetLabConf/bwlimit.php
deleted file mode 100755 (executable)
index 3e3cbc9..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
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  if ($nodenetworks[0]['bwlimit'] !== NULL) {
-    $rate = $nodenetworks[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";
-  }
-}
-
-?>
\ No newline at end of file
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/getupdatesxml.php b/PlanetLabConf/getupdatesxml.php
deleted file mode 100755 (executable)
index 8ca522b..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-//
-// Deprecated. Generates an XML file that the old PlanetLabConf script understands.
-//
-// Aaron Klingaman <alk@absarokasoft.com>
-// 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;
-
-function writeXMLHeader()
-{
-  print( "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n\n" );
-}
-
-define("ENT_UNPARSED", 0); // i.e., CDATA
-define("ENT_PARSED", 1); // i.e., PCDATA (attributes)
-
-function xmlspecialchars_decode($string, $parsed = ENT_UNPARSED)
-{
-  if ($parsed == ENT_PARSED) {
-    // &amp; to &
-    // &apos; to '
-    // &lt; to <
-    // &gt; to >
-    // &quot; to "
-    return str_replace('&amp;', '&',
-                      str_replace(array('&apos;', '&lt;', '&gt;', '&quot;'),
-                                  array("'", '<', '>', '"'),
-                                  $string));
-  } else {
-    // &amp; to &
-    // &apos; to '
-    // &lt; to <
-    // &gt; to >
-    // \" to "
-    // \\ to \
-    return str_replace('&amp;', '&',
-                      str_replace(array('&apos;', '&lt;', '&gt;', '\"', '\\'),
-                                  array("'", '<', '>', '"', "\\"),
-                                  $string));
-  }
-}
-  
-function xmlspecialchars($string, $parsed = ENT_UNPARSED)
-{
-  if ($parsed == ENT_PARSED) {
-    // & to &amp;
-    // ' to &apos;
-    // < to &lt;
-    // > to &gt;
-    // " to &quot;
-    $string = str_replace(array("'", '<', '>', '"'),
-                         array('&apos;', '&lt;', '&gt;', '&quot;'),
-                         str_replace('&', '&amp;', $string));
-  } else {
-    // & to &amp;
-    // ' to &apos;
-    // < to &lt;
-    // > to &gt;
-    // " to \"
-    // \ to \\
-    $string = str_replace(array("'", '<', '>', '"'),
-                         array('&apos;', '&lt;', '&gt;', '\"'),
-                         str_replace(array('&', "\\"),
-                                     array('&amp;', '\\'),
-                                     $string));
-  }
-
-  return utf8_encode($string);
-}
-    
-// Look up the node
-if (!empty($_REQUEST['node_id'])) {
-  $node = $adm->GetSlivers(intval($_REQUEST['node_id']));
-} else {
-  $nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-  if (!empty($nodenetworks)) {
-    $node = $adm->GetSlivers($nodenetworks[0]['node_id']);
-  }
-}
-
-if (empty($node)) {
-  exit();
-}
-$node_id = $node['node_id'];
-
-writeXMLHeader();
-$curtime= time();
-print( "<planetlab_conf version=\"0.1\" time=\"$curtime\">\n" );
-print( "<node id=\"$node_id\">\n" );
-
-foreach( $node['conf_files'] as $conf_file )
-{
-  $source            = xmlspecialchars($conf_file["source"]);
-  $dest              = xmlspecialchars($conf_file["dest"]);
-  $file_permissions  = xmlspecialchars($conf_file["file_permissions"]);
-  $file_owner        = xmlspecialchars($conf_file["file_owner"]);
-  $file_group        = xmlspecialchars($conf_file["file_group"]);
-  $preinstall_cmd    = xmlspecialchars($conf_file["preinstall_cmd"]);
-  $postinstall_cmd   = xmlspecialchars($conf_file["postinstall_cmd"]);
-  $error_cmd         = xmlspecialchars($conf_file["error_cmd"]);
-  $ignore_cmd_errors = $conf_file["ignore_cmd_errors"];
-  $always_update     = $conf_file["always_update"];
-
-  if( $ignore_cmd_errors == 1 )
-    $ignore_cmd_errors= "y";
-  else
-    $ignore_cmd_errors= "n";
-
-  if( $always_update == 1 )
-    $always_update= "y";
-  else
-    $always_update= "n";
-
-  print( "<file always_update=\"$always_update\" ignore_cmd_errors=\"$ignore_cmd_errors\">\n" );
-  print( "<source>$source</source>\n" );
-  print( "<destination>$dest</destination>\n" );
-  print( "<permissions>$file_permissions</permissions>\n" );
-  print( "<owner>$file_owner</owner>\n" );
-  print( "<group>$file_group</group>\n" );
-  print( "<preinstall_cmd>$preinstall_cmd</preinstall_cmd>\n" );
-  print( "<postinstall_cmd>$postinstall_cmd</postinstall_cmd>\n" );
-  print( "<error_cmd>$error_cmd</error_cmd>\n" );
-  print( "</file>\n" );
-}
-
-print( "</node>\n" );
-print( "</planetlab_conf>\n" );
-
-?>
diff --git a/PlanetLabConf/iptables b/PlanetLabConf/iptables
deleted file mode 100755 (executable)
index 1690448..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# /etc/sysconfig/iptables
-#
-# post: service iptables restart
-#
-# PlanetLab standard filter chains
-#
-# $Id$
-#
-
-
-*mangle
-:PREROUTING ACCEPT [0:0]
-:INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
-:POSTROUTING ACCEPT [0:0]
--A POSTROUTING -j MARK --copy-xid 0x0
--A INPUT -i ! lo -j MARK --copy-xid 0x0
-COMMIT
-
-*filter
-:INPUT ACCEPT [0:0]
-:FORWARD ACCEPT [0:0]
-:OUTPUT ACCEPT [0:0]
-:BLACKLIST - [0:0]
-:LOGDROP - [0:0]
--A OUTPUT -j BLACKLIST
--A LOGDROP -j LOG
--A LOGDROP -j DROP
--A OUTPUT -o eth0 -j ULOG --ulog-cprange 54 --ulog-qthreshold 16
-COMMIT
-
-
index 58721b0..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
-  $nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-  if (!empty($nodenetworks)) {
-    $nodes = $adm->GetNodes(array($nodenetworks[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 4676c23..afd0d76 100755 (executable)
@@ -18,9 +18,15 @@ $default_name = "default";
 $file_name = $config_directory . $file_prefix . $default_name;
 
 // Look up the node
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
+
+// 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)) {
     $node = $nodes[0];
   }
@@ -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 */
@@ -95,4 +105,4 @@ else {
   readfile($file_name); 
 } 
 
-?>
\ No newline at end of file
+?>
index aa14dd3..b939b79 100755 (executable)
@@ -3,4 +3,3 @@ server time.apple.com
 server pool.ntp.org
 server ntp.saard.net
 server ucsd.ron.lcs.mit.edu
-server ntp1.linux.medialabs.com
index 62b478e..386b7c9 100755 (executable)
@@ -1,4 +1,2 @@
-server ntp1.theinternetone.net
-server ntp2.theinternetone.net
-server ntp3.theinternetone.net
-server time.alcanet.no
+server tock.fh-augsburg.de
+server tack.fh-augsburg.de
index 3217953..d37ad09 100755 (executable)
@@ -1,5 +1,3 @@
-server s2a.time.edu.cn
-server s2b.time.edu.cn
 server clock.redhat.com
 server time.apple.com
 server pool.ntp.org
index bb193ea..80bfa5c 100755 (executable)
@@ -1,4 +1,3 @@
 server tock.fh-augsburg.de
-server tack.fh-augsburg.de
-server ntp2.theinternetone.net
-server ntp3.theinternetone.net
+server timeserver.rwth-aachen.de
+server clock.redhat.com
index ab41c82..a58a691 100755 (executable)
@@ -1,6 +1,2 @@
-server ntp1.theinternetone.net
-server ntp2.theinternetone.net
-server ntp3.theinternetone.net
-server time.alcanet.no
 server clock.netcetera.dk
 server clock2.netcetera.dk
index 1b66d3f..648bbeb 100755 (executable)
@@ -1,6 +1,3 @@
 server ntp.univ-lyon1.fr minpoll 5
 server ntp1.tuxfamily.net minpoll 5
 server ntp2.tuxfamily.net minpoll 5
-server ntp1.theinternetone.net minpoll 5
-server ntp2.theinternetone.net minpoll 5
-server ntp3.theinternetone.net minpoll 5
index 3041606..449dd1f 100755 (executable)
@@ -1,6 +1,3 @@
 server ntp.univ-lyon1.fr
 server ntp1.tuxfamily.net
 server ntp2.tuxfamily.net
-server ntp1.theinternetone.net
-server ntp2.theinternetone.net
-server ntp3.theinternetone.net
index 3a5e610..449dd1f 100755 (executable)
@@ -1,7 +1,3 @@
-server 132.227.74.33
 server ntp.univ-lyon1.fr
 server ntp1.tuxfamily.net
 server ntp2.tuxfamily.net
-server ntp1.theinternetone.net
-server ntp2.theinternetone.net
-server ntp3.theinternetone.net
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
index 98d0cc2..7fc31ce 100755 (executable)
@@ -18,9 +18,9 @@ $default_name = "default";
 $file_name = $config_directory . $file_prefix . $default_name;
 
 // Look up the node
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
+$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];
   }
@@ -77,4 +77,4 @@ foreach ($lines as $line_num => $line) {
   }
 }
 
-?>
\ No newline at end of file
+?>
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");
-       }
-}
-
-?>
-
diff --git a/PlanetLabConf/propd.conf b/PlanetLabConf/propd.conf
deleted file mode 100755 (executable)
index dd5a6d0..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#
-# default ACL:
-#
-# anyone can execute the get_file_flags operation (since it is applied
-# within the caller's vserver and the command lsattr gives the same
-# info anyway) or get the version string.  wait is harmless too since
-# the caller needs to know the child ID.  and we let any slice unmount
-# directories in its own filesystem, mostly as a workaround for some
-# Stork problems.
-#
-*: get_file_flags
-*: version
-*: wait
-+: unmount
-
-# give Stork permission to mount and unmount client dirs
-arizona_stork: mount_dir
-arizona_stork: set_file_flags pass, "1"
-arizona_stork: set_file_flags_list "1"
-arizona_stork: bind_socket sockname=64?:*
-arizona_stork2: mount_dir
-arizona_stork2: set_file_flags pass, "1"
-arizona_stork2: set_file_flags_list "1"
-arizona_stork2: bind_socket sockname=64?:*
-
-# give CoMon the necessary permissions to run slicestat
-princeton_slicestat: exec "root", pass, "/usr/local/planetlab/bin/pl-ps", none
-princeton_slicestat: exec "root", pass, "/usr/sbin/vtop", "bn1", none
-princeton_slicestat: open_file file=/proc/virtual/*/cacct
-princeton_slicestat: open_file file=/proc/virtual/*/limit
-princeton_comon: open_file file=/var/log/secure
-princeton_comon: exec "root", pass, "/bin/df", "/vservers", none
-
-# give pl_slicedir access to /etc/passwd
-pl_slicedir: open_file pass, "/etc/passwd"
-
-# netflow now runs in a slice so needs various accesses
-pl_netflow: open file=/etc/passwd, flags=r
-pl_netflow: open_file file=/etc/passwd
-pl_netflow: create_socket
-pl_netflow: bind_socket
-
-# nyu_d are building a DNS demux so give them access to port 53
-nyu_d: bind_socket
-nyu_oasis: bind_socket
-
-# QA slices need to be able to create and delete bind-mounts
-pl_qa_0: mount_dir
-pl_qa_1: mount_dir
-
-# irb_snort needs packet sockets for tcpdump
-irb_snort: create_socket
-
-# uw_ankur is using netlink sockets to do the same thing as netflow
-uw_ankur: create_socket
-
-# cornell_codons gets access to port 53 for now
-cornell_codons: create_socket
-
-# give Mic Bowman's conf-monitor service read-only access to root fs
-# and the ability to run df
-idsl_monitor: mount_dir "root:/", pass, "ro"
-idsl_monitor: unmount
-idsl_monitor: exec "root", pass, "/bin/df", "-P", "/", "/vservers", none
-
-# give Shark access to port 111 to run portmap
-# and port 955 to run mount
-nyu_shkr: bind_socket
-nyu_shkr: mount_dir "nfs:**:**"
-nyu_shkr: exec "root", pass, "/bin/umount", "-l", "/vservers/nyu_shkr/**", none
-
-# give tsinghua_lgh access to restricted ports
-tsinghua_lgh: bind_socket
-
-# CoDeeN needs port 53 too
-princeton_codeen: bind_socket sockname=53:*
-
-# give ucin_load access to /var/log/wtmp
-ucin_load: open_file file=/var/log/wtmp*
-
-# give google_highground permission to bind port 81 (and raw sockets)
-google_highground: bind_socket
-
-# pl_conf needs access to port 814
-pl_conf: bind_socket sockname=814:*
-pl_conf: open file=/home/*/.ssh/authorized_keys
-
-# give princeton_visp permission to read all packets sent through the
-# tap0 device
-princeton_visp: open file=/dev/net/tun, flags=rw
-
-# The PLB group needs the BGP port
-princeton_iias: bind_socket sockname=179:*
-princeton_visp: bind_socket sockname=179:*
-mit_rcp: bind_socket sockname=179:*
-
-# PL-VINI group
-mit_rcp: exec "root", pass, "/usr/bin/chrt"
-princeton_iias: exec "root", pass, "/usr/bin/chrt"
-uw_arvind: exec "root", pass, "/usr/bin/chrt"
index 39b9b39..4431aca 100755 (executable)
@@ -3,7 +3,7 @@
 #
 # post: service vnet restart
 #
-# Proxy (a.k.a. network telescope a.k.a. honeypot) nodenetwork configuration
+# Proxy (a.k.a. network telescope a.k.a. honeypot) interface configuration
 #
 # Aaron Klingaman <alk@cs.princeton.edu>
 # Mark Huang <mlhuang@cs.princeton.edu>
@@ -18,9 +18,19 @@ require_once 'plc_api.php';
 global $adm;
 
 // Look up the node
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
+// 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];
   }
@@ -30,18 +40,21 @@ if (!isset($node)) {
   exit();
 }
 
-$nodenetworks = $adm->GetNodeNetworks($node['nodenetwork_ids']);
+if ($__PLC_API_VERSION==4.2)
+  $interfaces = $adm->GetInterfaces($node['nodenetwork_ids']);
+else
+  $interfaces = $adm->GetInterfaces($node['interface_ids']);
 
-foreach ($nodenetworks as $nodenetwork) {
-  // XXX PL2896: need nodenetworks.device
-  switch ($nodenetwork['method']) {
+foreach ($interfaces as $interface) {
+  // XXX PL2896: need interfaces.device
+  switch ($interface['method']) {
   case 'tap':
     $dev = "tap0";
-    $types['taps'][$dev][0] = $nodenetwork['ip'] . "/" . $nodenetwork['gateway'];
+    $types['taps'][$dev][0] = $interface['ip'] . "/" . $interface['gateway'];
     break;
   case 'proxy':
     $dev = "proxy0";
-    $types['proxies'][$dev][] = $nodenetwork['ip'];
+    $types['proxies'][$dev][] = $interface['ip'];
     break;
   }
 }
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 edd8e86..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
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
-  if (!empty($nodes)) {
-    $node = $nodes[0];
-    $nodenetworks = $adm->GetNodeNetworks($node['nodenetwork_ids']);
-    foreach ($nodenetworks as $nodenetwork) {
-      // Nodes with proxy socket interfaces need to be able to forward
-      // between the fake proxy0 interface and the real interface.
-      if ($nodenetwork['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;
-  }
-}
-
-?>
index 004ce23..fdbf9dd 100755 (executable)
@@ -15,13 +15,13 @@ global $adm;
 if (!empty($_REQUEST['mac_addr'])) {
   $mac_lower = strtolower(trim($_REQUEST['mac_addr']));
   $mac_upper = strtoupper(trim($_REQUEST['mac_addr']));
-  $nodenetworks = $adm->GetNodeNetworks(array('mac' => array($mac_lower, $mac_upper)));
+  $interfaces = $adm->GetInterfaces(array('mac' => array($mac_lower, $mac_upper)));
 } else {
-  $nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
+  $interfaces = $adm->GetInterfaces(array('ip' => $_SERVER['REMOTE_ADDR']));
 }
 
-if (!empty($nodenetworks)) {
-  print $nodenetworks[0]['node_id'];
+if (!empty($interfaces)) {
+  print $interfaces[0]['node_id'];
 } else {
   print "-1";
 }
index ba7dc7b..9afe279 100755 (executable)
@@ -16,9 +16,9 @@ global $adm;
 $bootmanager = "bootmanager.sh.sgn";
 
 // Look up the node
-$nodenetworks = $adm->GetNodeNetworks(array('ip' => $_SERVER['REMOTE_ADDR']));
-if (!empty($nodenetworks)) {
-  $nodes = $adm->GetNodes(array($nodenetworks[0]['node_id']));
+$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];
   }
@@ -62,7 +62,7 @@ if (isset($node)) {
   if (!empty($node['nodegroup_ids'])) {
     $nodegroups = $adm->GetNodeGroups($node['nodegroup_ids']);
     foreach ($nodegroups as $nodegroup) {
-      $bootmanagers[] = strtolower($nodegroup['name']) . "_" . $bootmanager;
+      $bootmanagers[] = strtolower($nodegroup['groupname']) . "_" . $bootmanager;
     }
   }
 }
diff --git a/boot/upload-bmlog.php b/boot/upload-bmlog.php
new file mode 100755 (executable)
index 0000000..6e29e23
--- /dev/null
@@ -0,0 +1,112 @@
+<?php
+
+// Thierry Parmentelat -- INRIA
+// first draft for a revival of former (3.x?) alpina-logs in 5.0
+
+// this needs be created with proper permissions at package install time
+$logdir="/var/log/bm";
+
+// limit: applies to uploads coming from an unrecognized IP
+$limit_bytes=4*1024;
+
+$default_hostname="unknown";
+
+function mkdir_if_needed ($dirname) {
+  if (is_dir ($dirname))
+    return;
+  mkdir ($dirname) or die ("Cannot create dir " . $dirname);
+}
+  
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+// find the node that these longs should belong to by looking for a node_id
+// with an ip the same as the http requestor ip
+$ip = $_SERVER['REMOTE_ADDR'];
+
+$hostname=$default_hostname;
+// locate hostname from DB based on this IP
+$interfaces=$adm->GetInterfaces(array("ip"=>$ip));
+if (! empty($interfaces) ) {
+  $interface=$interfaces[0];
+  $node_id=$interface['node_id'];
+  $nodes=$adm->GetNodes($node_id,array("hostname"));
+  if (!empty($nodes)) {
+    $hostname=$nodes[0]['hostname'];
+  }
+ }
+
+// store the actual data in /var/log/bm/raw/2008-11-31-20-02-onelab01.inria.fr-138.96.250.141.txt
+
+$rawdir=$logdir . "/raw";
+$date=strftime("%Y-%m-%d-%H-%M");
+$log_name=$date . "-" . $hostname . "-" . $ip . ".txt";
+$log_path=$rawdir . "/" . $log_name;
+$month=strftime("%Y-%m");
+$time=strftime("%d-%H-%M");
+
+mkdir_if_needed ($rawdir);
+
+////////////////////////////////////////
+
+$log=fopen($log_path,"w") or die ("Cannot open logfile "+$log_path);
+
+$uploaded_name= $_FILES['log']['tmp_name'];
+$uploaded_size=filesize($uploaded_name);
+
+fprintf ($log, "BootManager log created on: %s-%s\n",$month,$time);
+fprintf( $log, "From IP: %s\n",$ip);
+fprintf( $log, "hostname: %s\n",$hostname);
+fprintf ( $log, "uploaded file: %s (%d bytes)\n",$uploaded_name,$uploaded_size);
+if ( ( strcmp($hostname,$default_hostname)==0) && ( $uploaded_size >= $limit_bytes) ) {
+  fprintf ( $log, "contents from an unrecognized IP address was truncated to %d bytes\n",$limit_bytes);
+  $truncated=TRUE;
+  $uploaded_size=$limit_bytes;
+ } else {
+  $truncated=FALSE;
+ }
+
+fprintf( $log, "-----------------\n\n" );
+$uploaded = fopen($uploaded_name,'r');
+$contents = fread($uploaded, $uploaded_size);
+fclose($uploaded);
+fwrite($log,$contents);
+if ($truncated)
+  fwrite ($log, " ..<" . "truncated" . ">..\n");
+fclose($log);
+
+////////////////////////////////////////
+
+// create symlinks for easy browsing
+
+// /var/log/bm/per-month/2008-11/onelab1.inria.fr/31-20-02.bmlog
+$linkdir=$logdir;
+$linkdir=$linkdir . "/per-month";
+mkdir_if_needed ($linkdir);
+$linkdir=$linkdir . "/" . $month;
+mkdir_if_needed ($linkdir);
+$linkdir = $linkdir . "/" . $hostname;
+mkdir_if_needed ($linkdir);
+$link = $linkdir . "/" . $time ;
+symlink ("../../../raw/".$log_name,$link);
+
+# /var/log/bm/per-hostname/onelab1.inria.fr/2008-11-31-20-02.bmlog
+$linkdir=$logdir;
+$linkdir=$linkdir . "/per-hostname";
+mkdir_if_needed ($linkdir);
+$linkdir=$linkdir . "/" . $hostname;
+mkdir_if_needed ($linkdir);
+$link = $linkdir . "/" . $month . "-" . $time ;
+symlink ("../../raw/".$log_name,$link);
+
+# /var/log/bm/per-ip/138.96.250.141/2008-11-31-20-02.bmlog
+$linkdir=$logdir;
+$linkdir=$linkdir . "/per-ip";
+mkdir_if_needed ($linkdir);
+$linkdir=$linkdir . "/" . $ip;
+mkdir_if_needed ($linkdir);
+$link = $linkdir . "/" . $month . "-" . $time ;
+symlink ("../../raw/".$log_name,$link);
+
+?>
index 0455d8f..17fe645 100644 (file)
@@ -1,11 +1,11 @@
 #
-# $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 $
 
 %define name nodeconfig
-%define version 5.0
-%define taglevel 0
+%define version 4.3
+%define taglevel 7
 
 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
 
@@ -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,9 @@ URL: %(echo %{url} | cut -d ' ' -f 2)
 
 # We use set everywhere
 Requires: php >= 5.0
-Requires: PLCAPI >= 4.0
+Requires: PLCAPI >= 4.3
+# need the apache user at install-time
+Requires: httpd 
 
 %description
 
@@ -40,30 +43,104 @@ 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."
+pushd nodeconfig/yum
+
+KEXCLUDE="exclude=$(../../build/getkexcludes.sh)"
+
+# expand list of kexcludes
+for filein in $(find . -name '*.in') ; do
+    file=$(echo $filein | sed -e "s,\.in$,,")
+    sed -e "s,@KEXCLUDE@,$KEXCLUDE,g" $filein > $file
+done
+
+# scan fcdistros and catenate all repos in 'stock.repo' so db-config can be distro-independant
+
+for fcdistro in $(ls); do
+    [ -d $fcdistro ] || continue
+    pushd $fcdistro/yum.myplc.d
+    rm -f stock.repo
+    cat *.repo > stock.repo
+    popd
+done
+
+popd
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
+pushd nodeconfig
+
 echo "* nodeconfig: Installing PlanetLabConf pages"
 
 for dir in boot 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
-# let's be conservative and exclude codebase files, though there should not be any
-rsync -a --exclude \*.spec --exclude .svn --exclude CVS ./ $RPM_BUILD_ROOT/var/www/html/
+
+# the yum area -- se db-config
+# expose (fixed) myplc.repo.php as                                         https://<plc>/yum/myplc.repo.php
+install -D -m 644 ./yum/myplc.repo.php                      $RPM_BUILD_ROOT/var/www/html/yum/myplc.repo.php
+# expose the fcdistro-dependant yum.conf as                                https://<plc>/yum/yum.conf
+install -D -m 644 ./yum/%{distroname}/yum.conf              $RPM_BUILD_ROOT/var/www/html/yum/yum.conf
+# expose the (fcdistro-dependant) stock.repo as                                    https://<plc>/yum/stock.repo
+install -D -m 644 ./yum/%{distroname}/yum.myplc.d/stock.repo $RPM_BUILD_ROOT/var/www/html/yum/stock.repo
+
+popd
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%post
+# the boot manager upload area
+mkdir -p /var/log/bm
+chown apache:apache /var/log/bm
+chmod 700 /var/log/bm
+
 %files
 %defattr(-,root,root,-)
 /var/www/html/boot
 /var/www/html/PlanetLabConf
 /var/www/html/PLCAPI
+/var/www/html/yum
 
 %changelog
+* 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
 - keys.php know about monitor
 - new sudoers.php script
diff --git a/yum/centos5/yum.conf b/yum/centos5/yum.conf
new file mode 100644 (file)
index 0000000..bfff95d
--- /dev/null
@@ -0,0 +1,22 @@
+[main]
+reposdir=/etc/yum.myplc.d
+pkgpolicy=newest
+exactarch=0
+keepcache=0
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+distroverpkg=redhat-release
+tolerant=1
+obsoletes=1
+gpgcheck=1
+plugins=0
+
+# Note: yum-RHN-plugin doesn't honor this.
+metadata_expire=1h
+
+# Default.
+# installonly_limit = 3
+
+# PUT YOUR REPOS HERE OR IN separate files named file.repo
+# in /etc/yum.repos.d
diff --git a/yum/centos5/yum.myplc.d/CentOS-Base.repo.in b/yum/centos5/yum.myplc.d/CentOS-Base.repo.in
new file mode 100644 (file)
index 0000000..be1e9c2
--- /dev/null
@@ -0,0 +1,62 @@
+# CentOS-Base.repo
+#
+# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
+# The mirror system uses the connecting IP address of the client and the
+# update status of each mirror to pick mirrors that are updated to and
+# geographically close to the client.  You should use this for CentOS updates
+# unless you are manually picking other mirrors.
+#
+# If the mirrorlist= does not work for you, as a fall back you can try the 
+# remarked out baseurl= line instead.
+#
+#
+
+[base]
+name=CentOS-$releasever - Base
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
+#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#released updates 
+[updates]
+name=CentOS-$releasever - Updates
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
+#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#packages used/produced in the build but not released
+[addons]
+name=CentOS-$releasever - Addons
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
+#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
+#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#additional packages that extend functionality of existing packages
+[centosplus]
+name=CentOS-$releasever - Plus
+mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
+#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
+@KEXCLUDE@
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
diff --git a/yum/centos5/yum.myplc.d/epel.repo.in b/yum/centos5/yum.myplc.d/epel.repo.in
new file mode 100644 (file)
index 0000000..1a844c1
--- /dev/null
@@ -0,0 +1,29 @@
+[epel]
+name=Extra Packages for Enterprise Linux 5 - $basearch
+#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
+failovermethod=priority
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+
+[epel-debuginfo]
+name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
+#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch/debug
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
+failovermethod=priority
+@KEXCLUDE@
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+gpgcheck=1
+
+[epel-source]
+name=Extra Packages for Enterprise Linux 5 - $basearch - Source
+#baseurl=http://download.fedoraproject.org/pub/epel/5/SRPMS
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
+failovermethod=priority
+@KEXCLUDE@
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
+gpgcheck=1
diff --git a/yum/f10/yum.conf b/yum/f10/yum.conf
new file mode 100644 (file)
index 0000000..13046c8
--- /dev/null
@@ -0,0 +1,10 @@
+[main]
+reposdir=/etc/yum.myplc.d
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+lockfile=/var/lock/yum.pid
+pkgpolicy=newest
+distroverpkg=fedora-release
+installonlypkgs=
+exactarch=0
diff --git a/yum/f10/yum.myplc.d/fedora-updates.repo.in b/yum/f10/yum.myplc.d/fedora-updates.repo.in
new file mode 100644 (file)
index 0000000..2323288
--- /dev/null
@@ -0,0 +1,29 @@
+[updates]
+name=Fedora $releasever - $basearch - Updates
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-source]
+name=Fedora $releasever - Updates Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
diff --git a/yum/f10/yum.myplc.d/fedora.repo.in b/yum/f10/yum.myplc.d/fedora.repo.in
new file mode 100644 (file)
index 0000000..b7cea58
--- /dev/null
@@ -0,0 +1,29 @@
+[fedora]
+name=Fedora $releasever - $basearch
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-debuginfo]
+name=Fedora $releasever - $basearch - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-source]
+name=Fedora $releasever - Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
diff --git a/yum/f12/yum.conf b/yum/f12/yum.conf
new file mode 100644 (file)
index 0000000..13046c8
--- /dev/null
@@ -0,0 +1,10 @@
+[main]
+reposdir=/etc/yum.myplc.d
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+lockfile=/var/lock/yum.pid
+pkgpolicy=newest
+distroverpkg=fedora-release
+installonlypkgs=
+exactarch=0
diff --git a/yum/f12/yum.myplc.d/fedora-updates.repo.in b/yum/f12/yum.myplc.d/fedora-updates.repo.in
new file mode 100644 (file)
index 0000000..2323288
--- /dev/null
@@ -0,0 +1,29 @@
+[updates]
+name=Fedora $releasever - $basearch - Updates
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-source]
+name=Fedora $releasever - Updates Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
diff --git a/yum/f12/yum.myplc.d/fedora.repo.in b/yum/f12/yum.myplc.d/fedora.repo.in
new file mode 100644 (file)
index 0000000..b7cea58
--- /dev/null
@@ -0,0 +1,29 @@
+[fedora]
+name=Fedora $releasever - $basearch
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-debuginfo]
+name=Fedora $releasever - $basearch - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-source]
+name=Fedora $releasever - Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
diff --git a/yum/f8/yum.conf b/yum/f8/yum.conf
new file mode 100644 (file)
index 0000000..13046c8
--- /dev/null
@@ -0,0 +1,10 @@
+[main]
+reposdir=/etc/yum.myplc.d
+cachedir=/var/cache/yum
+debuglevel=1
+logfile=/var/log/yum.log
+lockfile=/var/lock/yum.pid
+pkgpolicy=newest
+distroverpkg=fedora-release
+installonlypkgs=
+exactarch=0
diff --git a/yum/f8/yum.myplc.d/fedora-updates.repo.in b/yum/f8/yum.myplc.d/fedora-updates.repo.in
new file mode 100644 (file)
index 0000000..9f9b7f6
--- /dev/null
@@ -0,0 +1,59 @@
+[updates]
+name=Fedora $releasever - $basearch - Updates
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-source]
+name=Fedora $releasever - Updates Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
+[updates-newkey]
+name=Fedora $releasever - $basearch - Updates Newkey
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch.newkey/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever.newkey&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9
+
+[updates-newkey-debuginfo]
+name=Fedora $releasever - $basearch - Updates - Debug Newkey
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch.newkey/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-debug-f$releasever.newkey&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9
+
+[updates-newkey-source]
+name=Fedora $releasever - Updates Source Newkey
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/SRPMS.newkey/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-source-f$releasever.newkey&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9
diff --git a/yum/f8/yum.myplc.d/fedora.repo.in b/yum/f8/yum.myplc.d/fedora.repo.in
new file mode 100644 (file)
index 0000000..b7cea58
--- /dev/null
@@ -0,0 +1,29 @@
+[fedora]
+name=Fedora $releasever - $basearch
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=1
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-debuginfo]
+name=Fedora $releasever - $basearch - Debug
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-debug-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+
+[fedora-source]
+name=Fedora $releasever - Source
+failovermethod=priority
+#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/source/SRPMS/
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-source-$releasever&arch=$basearch
+@KEXCLUDE@
+enabled=0
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
diff --git a/yum/myplc.repo.php b/yum/myplc.repo.php
new file mode 100644 (file)
index 0000000..e76be48
--- /dev/null
@@ -0,0 +1,101 @@
+<?php
+//
+// part of yum config on nodes
+//
+// Thierry Parmentelat 
+// Copyright (C) 2008 INRIA
+//
+// $Id: myplc.repo.php 9818 2008-07-04 07:54:06Z thierry $
+//
+
+// For PLC_NAME and PLC_BOOT_HOST
+include('plc_config.php');
+
+$PLC_NAME = PLC_NAME;
+$PLC_BOOT_HOST = PLC_BOOT_HOST;
+
+// Get admin API handle
+require_once 'plc_api.php';
+global $adm;
+
+if (isset($_REQUEST['gpgcheck'])) {
+  $gpgcheck = $_REQUEST['gpgcheck'];
+} else {
+  $gpgcheck = 0;
+}
+
+# get node family
+if ( ! isset($_REQUEST['slicefamily'])) {
+  # legacy : use the old naming scheme
+  $nodefamily="planetlab";
+  $pldistro="planetlab";
+ } else {
+  $slicefamily = $_REQUEST['slicefamily'];
+  echo "# slicefamily $slicefamily \n" ;
+  list( $pldistro, $fcdistro, $arch) = split ("-", $slicefamily);
+  $nodefamily = "$pldistro-$arch";
+  echo "# nodefamily $nodefamily \n" ;
+ }
+
+# the nodegroups the node is part of
+$nodegroup_names=array();
+
+if ( ! isset($_REQUEST['node_id'])) {
+  print "# Warning : node_id not set\n";
+ } else {
+  $node_id=intval($_REQUEST['node_id']);
+  echo "# node_id $node_id \n";
+  # compute nodegroups
+  $nodes = $adm->GetNodes(array('node_id'=>$node_id));
+  $nodegroup_ids = $nodes[0]['nodegroup_ids'];
+  $nodegroups = $adm->GetNodeGroups($nodegroup_ids);
+  foreach ($nodegroups as $nodegroup) {
+    $nodegroup_name = $nodegroup['groupname'];
+    $nodegroup_names [] = $nodegroup_name;
+    echo "# in nodegroup $nodegroup_name \n" ;
+  }
+ }
+
+$topdir=$_SERVER['DOCUMENT_ROOT'] . "/install-rpms/";
+$topurl="https://$PLC_BOOT_HOST" . "/install-rpms/";
+
+
+# locate the planetlab repo for this node family & nodegroup
+$repo=NULL;
+foreach ($nodegroup_names as $nodegroup_name) {
+  $groupdir = "$nodefamily-$nodegroup_name";
+  # have we got a repo like /install-rpms/planetlab-i386-alpha ?
+  echo "# trying " . $topdir . $groupdir . "\n";
+  if (is_dir (realpath($topdir . $groupdir))) {
+    $repo=array($pldistro, $groupdir, "$PLC_NAME $nodefamily $nodegroup_name");
+    break;
+  }
+}
+
+# if not found yet
+if ( ! $repo) {
+  echo "# trying default " . $topdir . $nodefamily . "\n";
+  if (is_dir (realpath($topdir . $nodefamily))) {
+    $repo = array($pldistro, $nodefamily, "$PLC_NAME $nodefamily regular");
+  }
+ }
+
+# default: if we're here it's probably very wrong
+if ( ! $repo) {
+  echo "# WARNING: could not find a decent planetlab repo for this node\n";
+  $repo = array ($pldistro, "planetlab", "default probably wrong");
+  # don't define the repo in this case
+  exit;
+ }
+
+list( $id, $dir, $name) = $repo;
+
+echo <<< __PLC_REPO__
+[$id]
+name=$name
+baseurl=$topurl/$dir
+gpgcheck=$gpgcheck
+
+__PLC_REPO__;
+
+?>