--- /dev/null
+### $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
+
+++ /dev/null
------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-----
+++ /dev/null
-# 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
+++ /dev/null
-# RootResources/pl_netflow
-
-try:
- pl_netflow = RootSlice(nm_vserver_flags = "syncstart",
- nm_cpu_share = 32)
-except:
- pass
+++ /dev/null
-<?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)
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];
}
+++ /dev/null
-<?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
--- /dev/null
+<?php
+
+require_once 'plc_api.php';
+global $adm;
+
+if (isset($_REQUEST['node_id'])) {
+ $node_id = intval($_REQUEST['node_id']);
+ print $adm->GetNodeExtensions($node_id);
+}
+
+?>
+
// 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';
}
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'");
+++ /dev/null
-<?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) {
- // & to &
- // ' to '
- // < to <
- // > to >
- // " to "
- return str_replace('&', '&',
- str_replace(array(''', '<', '>', '"'),
- array("'", '<', '>', '"'),
- $string));
- } else {
- // & to &
- // ' to '
- // < to <
- // > to >
- // \" to "
- // \\ to \
- return str_replace('&', '&',
- str_replace(array(''', '<', '>', '\"', '\\'),
- array("'", '<', '>', '"', "\\"),
- $string));
- }
-}
-
-function xmlspecialchars($string, $parsed = ENT_UNPARSED)
-{
- if ($parsed == ENT_PARSED) {
- // & to &
- // ' to '
- // < to <
- // > to >
- // " to "
- $string = str_replace(array("'", '<', '>', '"'),
- array(''', '<', '>', '"'),
- str_replace('&', '&', $string));
- } else {
- // & to &
- // ' to '
- // < to <
- // > to >
- // " to \"
- // \ to \\
- $string = str_replace(array("'", '<', '>', '"'),
- array(''', '<', '>', '\"'),
- str_replace(array('&', "\\"),
- array('&', '\\'),
- $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" );
-
-?>
+++ /dev/null
-#
-# /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
-
-
<?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)
$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) {
}
}
}
-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";
-}
?>
$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];
}
$site_name= $sites[0]['name'];
$mylat= $sites[0]['latitude'];
$mylong= $sites[0]['longitude'];
+} else {
+ $site_name= "Unknown";
+ $mylat= 0;
+ $mylong= 0;
}
/* typical NTP settings */
readfile($file_name);
}
-?>
\ No newline at end of file
+?>
server pool.ntp.org
server ntp.saard.net
server ucsd.ron.lcs.mit.edu
-server ntp1.linux.medialabs.com
-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
-server s2a.time.edu.cn
-server s2b.time.edu.cn
server clock.redhat.com
server time.apple.com
server pool.ntp.org
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
-server ntp1.theinternetone.net
-server ntp2.theinternetone.net
-server ntp3.theinternetone.net
-server time.alcanet.no
server clock.netcetera.dk
server clock2.netcetera.dk
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
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
-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
--- /dev/null
+server ntp1.tp.pl
+server ntp2.tp.pl
--- /dev/null
+server ntp1.tp.pl
+server ntp2.tp.pl
$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];
}
}
}
-?>
\ No newline at end of file
+?>
+++ /dev/null
-<?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");
- }
-}
-
-?>
-
+++ /dev/null
-#
-# 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"
#
# 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>
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];
}
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;
}
}
--- /dev/null
+<?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();
+
+?>
+++ /dev/null
-# -----------------------------------------------------------------
-# 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
--- /dev/null
+<?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; ?>
--- /dev/null
+# 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
+
+++ /dev/null
-<?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
+++ /dev/null
-<?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;
- }
-}
-
-?>
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";
}
$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];
}
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;
}
}
}
--- /dev/null
+<?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);
+
+?>
#
-# $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}}
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>
# 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
%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
--- /dev/null
+[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
--- /dev/null
+# 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
+
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+[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
--- /dev/null
+<?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__;
+
+?>