Changeset 16395
- Timestamp:
- 2008-07-14T15:21:19+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/g2futil.pm
r16363 r16395 290 290 291 291 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"); 293 297 294 298 # 1. Find out which folder to write to: fedora_host or localhost … … 305 309 if(!-e $xmlFile) { 306 310 # 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"; 308 312 } 309 313 } … … 347 351 my $stop_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "shutdown".$script_ext); 348 352 # execute the command 349 $! =0; # does this initialise the return value?353 $! = 0; # does this initialise the return value? 350 354 my $status = system($stop_tomcat); 351 355 if ($status!=0) { # to get the actual exit value, divide by 256, but not useful here … … 365 369 # c. Restart the fedora server 366 370 my $start_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "startup".$script_ext); 367 $! =0;371 $! = 0; 368 372 $status = system($start_tomcat); 369 373 if ($status!=0) { … … 371 375 print "Exit status = ", $status/256, "\n"; 372 376 } 373 377 378 # reset CATALINA_HOME to GS' Tomcat: 379 $ENV{'CATALINA_HOME'} = $gs_catalina_home; 374 380 375 381 # Starting up the Fedora server takes a long time. We need to wait for the server to be … … 390 396 391 397 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; 394 401 my $fedoraServerReady = system("wget -q --spider --waitretry=3 --tries=20 $protocol://$hostname:$port/fedora/search"); 395 402 if($fedoraServerReady != 0) { 396 403 print STDERR "Fedora server is still not ready... ERROR: $!\n"; 397 print "Exit status = ", $ status/256, "\n";404 print "Exit status = ", $fedoraServerReady/256, "\n"; 398 405 die "Exiting....\n"; 399 406 } 400 407 401 408 # return some indication that things went well 402 409 return "gsdl.xml";
Note:
See TracChangeset
for help on using the changeset viewer.