Changeset 16395 for gsdl


Ignore:
Timestamp:
2008-07-14T15:21:19+12:00 (16 years ago)
Author:
ak19
Message:
  1. For Fedora CATALINA_HOME ought to be its own tomcat, but When Greenstone 3 is remote (but not when it's local, for some reason) CATALINA_HOME is set to GS3's tomcat. This causes the fedora restart to fail after gsdl.xml was created. 2. Other fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/g2futil.pm

    r16363 r16395  
    290290
    291291    print STDERR "Ensuring that a correct gsdl.xml file exists on the Fedora server end\n";
    292     # The top of this file has already made sure that FEDORA_HOME is set
     292    # The top of this file has already made sure that FEDORA_HOME is set, but for GS3
     293    # CATALINA_HOME is set to GS' own tomcat. Since we'll be working with fedora, we need
     294    # to temporarily set CATALINA_HOME to fedora's tomcat:
     295    my $gs_catalina_home = $ENV{'CATALINA_HOME'};
     296    $ENV{'CATALINA_HOME'} = &util::filename_cat($ENV{'FEDORA_HOME'}, "tomcat");
    293297
    294298    # 1. Find out which folder to write to: fedora_host or localhost
     
    305309    if(!-e $xmlFile) {
    306310        # try putting gsdl in this folder, but still print a warning
    307         print STDERR "**** $host_path does not contain file fedora.xml. Hoping gsdl.xml belongs there anyway\n";
     311        print STDERR "$host_path does not contain file fedora.xml. Hoping gsdl.xml belongs there anyway\n";
    308312    }
    309313    }
     
    347351    my $stop_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "shutdown".$script_ext);
    348352    # execute the command
    349     $!=0; # does this initialise the return value?
     353    $! = 0; # does this initialise the return value?
    350354    my $status = system($stop_tomcat);
    351355    if ($status!=0) { # to get the actual exit value, divide by 256, but not useful here
     
    365369    # c. Restart the fedora server
    366370    my $start_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "startup".$script_ext);
    367     $!=0;
     371    $! = 0;
    368372    $status = system($start_tomcat);
    369373    if ($status!=0) {
     
    371375    print "Exit status = ", $status/256, "\n";
    372376    }
    373    
     377
     378    # reset CATALINA_HOME to GS' Tomcat:
     379    $ENV{'CATALINA_HOME'} = $gs_catalina_home;
    374380   
    375381    # Starting up the Fedora server takes a long time. We need to wait for the server to be
     
    390396
    391397    print STDERR "Fedora server restarted. Waiting for it to become ready...\n";
    392    
    393     # print STDERR "****$protocol://$hostname:$port/fedora/search\n";
     398    #print STDERR "****$protocol://$hostname:$port/fedora/search\n";
     399   
     400    $! = 0;
    394401    my $fedoraServerReady = system("wget -q --spider --waitretry=3 --tries=20 $protocol://$hostname:$port/fedora/search");
    395402    if($fedoraServerReady != 0) {
    396403    print STDERR "Fedora server is still not ready... ERROR: $!\n";
    397     print "Exit status = ", $status/256, "\n";
     404    print "Exit status = ", $fedoraServerReady/256, "\n";
    398405    die "Exiting....\n";
    399406    }
    400    
     407
    401408    # return some indication that things went well
    402409    return "gsdl.xml";
Note: See TracChangeset for help on using the changeset viewer.