perfsonar-dev - perfsonar: r2236 - trunk/perfsonar-bundle
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r2236 - trunk/perfsonar-bundle
- Date: Wed, 14 Mar 2007 15:40:53 -0400
Author: fernandes
Date: 2007-03-14 15:40:53 -0400 (Wed, 14 Mar 2007)
New Revision: 2236
Modified:
trunk/perfsonar-bundle/install.pl
Log:
Script seems done, minor modifications are probably needed until release
though..
Modified: trunk/perfsonar-bundle/install.pl
===================================================================
--- trunk/perfsonar-bundle/install.pl 2007-03-14 15:42:53 UTC (rev 2235)
+++ trunk/perfsonar-bundle/install.pl 2007-03-14 19:40:53 UTC (rev 2236)
@@ -14,12 +14,12 @@
use constant {
RRDMA => 1,
- SQLMA => 2,
- SSH => 3,
- CLMP => 4,
- LS => 5,
- BWCTL => 6,
- PERL => 6 #The number where perl services start
+ SQLMA => 2,
+ SSH => 3,
+ CLMP => 4,
+ LS => 5,
+ BWCTL => 6,
+ PERL => 6 #The number where perl services start
};
my $service;
@@ -33,50 +33,51 @@
my $isPerl = '';
my %serviceDisplayMap = (
- RRDMA() => "RRD MA",
- SQLMA() => "SQL MA",
- SSH() => "SSH/Telnet MP",
- CLMP() => "Command Line MP",
- LS() => "Lookup Service",
- BWCTL() => "BWCTL MP",
- );
+ RRDMA() => "RRD MA",
+ SQLMA() => "SQL MA",
+ SSH() => "SSH/Telnet MP",
+ CLMP() => "Command Line MP",
+ LS() => "Lookup Service",
+ BWCTL() => "BWCTL MP",
+ );
my %serviceMap = (
- RRDMA() => "RRD-MA",
- SQLMA() => "SQL-MA",
- SSH() => "TelnetSSHMP",
- CLMP() => "CLMP",
- LS() => "LS",
- BWCTL() => "BWCTL",
- );
+ RRDMA() => "RRD-MA",
+ SQLMA() => "SQL-MA",
+ SSH() => "TelnetSSHMP",
+ CLMP() => "CLMP",
+ LS() => "LS",
+ BWCTL() => "BWCTL",
+ );
my %servicesTar = (
- RRDMA() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-RRD-MA-2.0-RC8.tar.gz",
- CLMP() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-CLMP-1.0-RC5.tar.gz",
- SSH() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/MPTelnetSSH-0.10.tar.gz",
- SQLMA() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-SQL-MA-1.0-RC5.tar.gz",
- LS() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-XML-LS-1.1-RC4.tar.gz",
- BWCTL() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/Perl-perfsonar-0.2-RC5.tar.gz",
- );
+ RRDMA() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-RRD-MA-2.0-RC8.tar.gz",
+ CLMP() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-CLMP-1.0-RC5.tar.gz",
+ SSH() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/MPTelnetSSH-0.10.tar.gz",
+ SQLMA() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-SQL-MA-1.0-RC5.tar.gz",
+ LS() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/perfSONAR-XML-LS-1.1-RC4.tar.gz",
+ BWCTL() =>
"http://anonsvn.internet2.edu/svn/pS-download/trunk/download/services/Perl-perfsonar-0.2-RC5.tar.gz",
+ );
my $currentDir = `pwd`;
chomp($currentDir);
$currentDir .= "/";
while('true'){
-
+
&introMenu();
}
sub introMenu(){
-
+
my $menu = "Welcome to the perfSONAR services installer.\n\n";
$menu .= "What would you like to do?\n";
$menu .= "1. Install a new service\n";
- $menu .= "2. Modify or test an existing installation\n";
- $menu .= "3. Give feedback to the perfSONAR team\n";
+ $menu .= "2. Modify or test an existing installation (JAVA)\n";
+ $menu .= "3. Modify or test an existing installation (PERL)\n";
+ $menu .= "4. Give feedback to the perfSONAR team\n";
$menu .= "Please choose a number [enter to exit]: ";
print $menu;
my $choice = <STDIN>;
@@ -97,6 +98,11 @@
&advanced();
}
case 3 {
+ $modification = '1';
+ $isPerl = '1';
+ &perlModifyMenu();
+ }
+ case 4 {
&getFeedback();
}
case "" { exit; }
@@ -105,67 +111,96 @@
}
+sub perlModifyMenu() {
+ my $menu;
+ my $key = PERL();
+ my $tmp = 'ok';
+
+
+ $menu = "\nWhat's the type of service that you want to modify/test?\n";
+ while ($tmp ne '') {
+ $menu .= "$key. $serviceDisplayMap{$key}\n";
+ $key++;
+ $tmp = $serviceDisplayMap{$key};
+ }
+ $menu .= "Please choose a number [enter to exit]: ";
+ print $menu;
+ $service = <STDIN>;
+ chomp($service);
+
+ if ($service eq ''){
+ exit;
+ }
+
+ if (!($service =~ /^[1-9]$/) || $service >= $key || $service < PERL()){
+ print "\nPlease type a valid number.\n";
+ &perlModifyMenu();
+ }
+
+ &installDir();
+}
+
sub getFeedback(){
- my $menu;
- my $stop = '';
- my $message;
- my $name;
- my $email;
- my $org;
- my $tmp;
-
- $menu = "\nBe free to write any complaints, suggestions or comments,
any type \n";
- $menu .= "of feedback is appreciated. Your feedback will be sent to
perfSONAR's \n";
- $menu .= "<XXX> mailing list. You'll be asked to give some personal
information \n";
- $menu .= "first, it is completely optional (you can just press enter
to ignore): \n";
- $menu .= "\nYour name: ";
- print $menu;
- $name = <STDIN>;
- chomp($name);
-
- print "Email: ";
- $email = <STDIN>;
- chomp($email);
+ my $menu;
+ my $stop = '';
+ my $message;
+ my $name;
+ my $email;
+ my $org;
+ my $tmp;
- print "Organization: ";
- $org = <STDIN>;
- chomp($org);
-
- $message = "Name: $name\n"."Email: $email\n"."Organization:
$org\n\n";
-
- print "You can now type your message, write 'STOP' in a newline when
you have finished.\n";
- while (!$stop){
- $tmp = <STDIN>;
- chomp($tmp);
-
- if ($tmp ne 'STOP'){
- $message .= $tmp."\n";
- }
- else{
- $stop = 'true';
- }
+ $menu = "\nBe free to write any complaints, suggestions or comments, any
type \n";
+ $menu .= "of feedback is appreciated. Your feedback will be sent to
perfSONAR's \n";
+ $menu .= "<XXX> mailing list. You'll be asked to give some personal
information \n";
+ $menu .= "first, it is completely optional (you can just press enter to
ignore): \n";
+ $menu .= "\nYour name: ";
+ print $menu;
+ $name = <STDIN>;
+ chomp($name);
+
+ print "Email: ";
+ $email = <STDIN>;
+ chomp($email);
+
+ print "Organization: ";
+ $org = <STDIN>;
+ chomp($org);
+
+ $message = "Name: $name\n"."Email: $email\n"."Organization: $org\n\n";
+
+ print "You can now type your message, write 'STOP' in a newline when you
have finished.\n";
+ while (!$stop){
+ $tmp = <STDIN>;
+ chomp($tmp);
+
+ if ($tmp ne 'STOP'){
+ $message .= $tmp."\n";
}
+ else{
+ $stop = 'true';
+ }
+ }
- print "\nSending your feedback...\n";
+ print "\nSending your feedback...\n";
- $req->content('message=122345='.$message);
- my $res = $ua->request($req);
-
- if ($res->is_success && !($res->as_string =~ /NOT-OK/)){
- print "\n\nYour feedback was sent successfully, thank you!\n\n";
- }else{
- print "\n\nAn error ocurred while trying to send your feedback.
Please take\n";
- print "your time to write it to
<feedbackml>\@perfsonar.net,
it's very \n";
- print "important to us. Thank you!\n";
- print "Press any key to continue...\n";
- <STDIN>;
- }
+ $req->content('message=12345='.$message);
+ my $res = $ua->request($req);
+
+ if ($res->is_success && !($res->as_string =~ /NOT-OK/)){
+ print "\n\nYour feedback was sent successfully, thank you!\n\n";
+ }else{
+ print "\n\nAn error ocurred while trying to send your feedback.
Please take\n";
+ print "your time to write it to
<feedbackml>\@perfsonar.net,
it's very \n";
+ print "important to us. Thank you!\n";
+ print "Press any key to continue...\n";
+ <STDIN>;
+ }
}
sub getProperties(){
my $menu;
my $const;
-
+
if (system("test -f
".$serviceDir."classes/perfsonar/conf/const.properties") != 0){
$menu = "\nI could not find the const.properties file last used for
this \n";
$menu .= "service. If you know it's location you can now type it's
path or \n";
@@ -174,7 +209,7 @@
print $menu;
$const = <STDIN>;
chomp($const);
-
+
if (!($const =~ /const.properties$/) || system("test -f ".$const) !=
0){
if ($const ne ''){
print "\nThe file $const doesn't seems to be valid.\n\n";
@@ -193,13 +228,13 @@
print "File copied successfully. Continuing...\n";
}
system("cp $const ".$serviceDir.
- "classes/perfsonar/conf/const.properties ".$installDir."ant/ 2>
/dev/null");
+ "classes/perfsonar/conf/const.properties
".$installDir."ant/ 2> /dev/null");
}
}else{
print "\nI'm now copying the latest configuration used for this
service...\n";
if (system("cp ".$serviceDir.
- "classes/perfsonar/conf/const.properties ".$installDir."ant/" !=
0)){
-
+ "classes/perfsonar/conf/const.properties
".$installDir."ant/" != 0)){
+
$menu = "\nAn error occurred when trying to copy the file
const.properties from \n";
$menu .= $serviceDir."classes/perfsonar/conf/. \n";
$menu .= "You can try to do this manually, otherwise the
const.properties file \n";
@@ -209,7 +244,7 @@
<STDIN>;
}
}
-
+
}
sub modifyMenu() {
@@ -219,45 +254,52 @@
my $i;
my $serviceName;
- &getWebapps();
-
- &getServiceDir();
-
- for my $key ( keys %serviceMap ) {
- if ($serviceDir =~ /$serviceMap{$key}/){
- $service = $key;
- }
- }
+ $menu = "\nI'I couldn't detect the type of the service you want \n";
+ $menu .= "to modify. You'll need to do this manually: \n";
+ $menu .= "Please choose a number [enter to exit]: ";
+ while ($invalid){
+ print $menu;
+ $service = <STDIN>;
- if ($service){
- &installDir();
- }else {
- my $menu = "\nI couldn't detect the type of the service you want \n";
- $menu .= "to modify. You'll need to do this manually: \n";
- $menu .= "1. RRD-MA\n";
- $menu .= "2. SQL-MA\n";
- $menu .= "3. SSH/Telnet MP\n";
- $menu .= "4. Commande Line MP\n";
- $menu .= "Please choose a number [enter to exit]: ";
- while ($invalid){
- print $menu;
- $service = <STDIN>;
- chomp($service);
+ &getWebapps();
- if ($service == ""){
- exit;
- }
+ &getServiceDir();
- if (!($service =~ /^[1234]$/)){
- print "\nPlease type a valid number.\n\n";
- }else{
- $invalid = 0;
+ for my $key ( keys %serviceMap ) {
+ if ($serviceDir =~ /$serviceMap{$key}/){
+ $service = $key;
+ }
+ }
+
+ if ($service){
+ &installDir();
+ }else {
+ $menu = "\nI couldn't detect the type of the service you want
\n";
+ $menu .= "to modify. You'll need to do this manually: \n";
+ $menu .= "1. RRD-MA\n";
+ $menu .= "2. SQL-MA\n";
+ $menu .= "3. SSH/Telnet MP\n";
+ $menu .= "4. Commande Line MP\n";
+ $menu .= "Please choose a number [enter to exit]: ";
+ while ($invalid){
+ print $menu;
+ $service = <STDIN>;
+ chomp($service);
+
+ if ($service == ""){
+ exit;
+ }
+
+ if (!($service =~ /^[1234]$/)){
+ print "\nPlease type a valid number.\n\n";
+ }else{
+ $invalid = 0;
+ }
}
+ &installDir();
}
- &installDir();
}
}
-
sub getServiceDir() {
my $menu;
my $choice;
@@ -294,7 +336,7 @@
print "the desired service: ";
$serviceDir = <STDIN>;
chomp($serviceDir);
-
+
if ($serviceDir =~ /WEB-INF$/){
$serviceDir .= '/';
}
@@ -333,7 +375,7 @@
my $choice;
my $invalid = 1;
my $i;
-
+
if (&detectWebapps()){
$menu .= "\nI have detected the webapps directory at the following
\n";
if (scalar(@dirs) > 1) {
@@ -385,7 +427,7 @@
if ($webappsDir ne $dirs[0]){
`echo "webapps=$webappsDir" >> .install.conf`;
}
-
+
}
if (system("test -d ".$webappsDir) != 0){
print "\nDirectory $webappsDir doesn't seems to be a valid
directory.\n\n";
@@ -399,14 +441,14 @@
print $menu;
$choice = <STDIN>;
chomp($choice);
-
+
if ($choice ne ''){
$webappsDir = $choice;
if ($webappsDir ne $dirs[0]){
`echo "webapps=$webappsDir" >> .install.conf`;
}
}
-
+
if (system("test -d ".$webappsDir) != 0){
print "\nDirectory $webappsDir doesn't seems to be a valid
directory.\n\n";
exit;
@@ -489,7 +531,7 @@
if (!($installDir =~ /\/$/)){
$installDir .= '/';
}
-
+
if (!$isPerl){
if (!($installDir =~ /perfsonar\/$/)){
$installDir .= 'perfsonar/';
@@ -557,7 +599,7 @@
if (!($choice =~ /\/$/)){
$choice = $choice . "/";
}
-
+
$installDir = $choice
}
@@ -574,7 +616,7 @@
if (!$isPerl){
$installDir .= "perfsonar/";
}
-
+
if (!($installDir =~ /^\./) && !($installDir =~ /$currentDir/)){
`echo "$serviceMap{$service}=$installDir" >> .install.conf`;
}
@@ -586,7 +628,7 @@
my $menu;
my $key = 1;
my $tmp = $serviceDisplayMap{$key};
-
+
$menu = "\nWhich service would like to install?\n";
while ($tmp ne '') {
$menu .= "$key. $serviceDisplayMap{$key}\n";
@@ -683,7 +725,7 @@
return;
}
}
-
+
if(!$isPerl){
©Const();
}
@@ -711,7 +753,7 @@
}
sub advanced(){
-
+
my $menu = "\nAvailable actions: \n";
$menu .= "1. pre-install\n";
$menu .= "2. configure\n";
@@ -723,7 +765,7 @@
$menu .= "Please choose a number: ";
print $menu;
my $choice = <STDIN>;
-
+
chomp($choice);
switch ($choice){
@@ -760,21 +802,21 @@
chomp($web);
my $name = `cat $tmp | grep "^service.name" | cut -d '=' -f 2`;
chomp($name);
-
+
if (system("cp ".$installDir."ant/const.properties ".$web."/"
- .$name."/WEB-INF/classes/perfsonar/conf/const.properties") != 0){
-
- $menu = "\nAn error occurred when trying to copy the file
const.properties to \n";
- $menu .= "the directory where the service was installed. The
directory used was: \n";
- $menu .= $web."/".$name."/WEB-INF/classes/perfsonar/conf/ \n";
- $menu .= "This file is copied so that it can be used in future
modifications \n";
- $menu .= "to the service through the use of this script. I
recommend that you \n";
- $menu .= "copy the file ".$installDir."ant/const.properties \n";
- $menu .= "to the mentioned directory (or to the right one if the
path detected \n";
- $menu .= "of the service's WEB-INF directory is wrong). \n";
- $menu .= "Press any key to continue...\n";
- print $menu;
- <STDIN>;
+ .$name."/WEB-INF/classes/perfsonar/conf/const.properties")
!= 0){
+
+ $menu = "\nAn error occurred when trying to copy the file
const.properties to \n";
+ $menu .= "the directory where the service was installed. The
directory used was: \n";
+ $menu .= $web."/".$name."/WEB-INF/classes/perfsonar/conf/ \n";
+ $menu .= "This file is copied so that it can be used in future
modifications \n";
+ $menu .= "to the service through the use of this script. I recommend
that you \n";
+ $menu .= "copy the file ".$installDir."ant/const.properties \n";
+ $menu .= "to the mentioned directory (or to the right one if the
path detected \n";
+ $menu .= "of the service's WEB-INF directory is wrong). \n";
+ $menu .= "Press any key to continue...\n";
+ print $menu;
+ <STDIN>;
}
}
- perfsonar: r2236 - trunk/perfsonar-bundle, svnlog, 03/14/2007
Archive powered by MHonArc 2.6.16.