Changeset 15605
- Timestamp:
- 2008-05-20T18:44:14+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/g2futil.pm
r15582 r15605 5 5 { 6 6 if (!defined $ENV{'FEDORA_HOME'}) { 7 print STDERR "E RROR: Environment variable FEDORA_HOME not set.\n";7 print STDERR "Error: Environment variable FEDORA_HOME not set.\n"; 8 8 exit 1; 9 9 } … … 11 11 my $fedora_home = $ENV{'FEDORA_HOME'}; 12 12 my $fedora_client_bin = &util::filename_cat($fedora_home,"client","bin"); 13 $ENV{'PATH'} .= ":$fedora_client_bin"; 13 if($ENV{'GSDLOS'} =~ m/^windows/) { 14 $ENV{'PATH'} .= ";$fedora_client_bin"; 15 } else { 16 $ENV{'PATH'} .= ":$fedora_client_bin"; 17 } 14 18 } 15 19 … … 60 64 } 61 65 62 63 66 my $cmd = "$prog $arguments"; 64 67 65 ###print "*** cmd = $cmd\n";68 print "*** cmd = $cmd\n"; 66 69 67 70 if (open(CMD,"$cmd 2>&1 |")) … … 237 240 sub write_gsdl_xml_file 238 241 { 239 my ($fedora_host, $collect_dir) = @_; 240 242 my ($fedora_host, $collect_dir, $options) = @_; 243 my $verbosity = $options->{'verbosity'}; 244 241 245 print STDERR "Ensuring that a correct gsdl.xml file exists on the Fedora server end\n"; 242 246 # The top of this file has already made sure that FEDORA_HOME is set … … 264 268 my $collectParentDir = $collect_dir; 265 269 $collectParentDir =~ s/collect(\/|\\)?//; 270 271 #replace \ in path as occurs on Windows with /? 272 #$collectParentDir =~ s/\\/\//g; 266 273 #print STDERR "**** collect's parent dir is: $collectParentDir\n"; 267 274 … … 294 301 # 4. If we're here, the contents of gsdl.xml need to be updated: 295 302 # a. First stop the fedora server 296 my $stop_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "shutdown.sh"); 303 my $script_ext = ($ENV{'GSDLOS'} =~ m/^windows/) ? ".bat" : ".sh"; 304 my $stop_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "shutdown".$script_ext); 297 305 # execute the command 298 306 $!=0; # does this initialise the return value? 299 if (system($stop_tomcat)!=0) { # to get the actual exit value, divide by 256, but not useful here 307 my $status = system($stop_tomcat); 308 if ($status!=0) { # to get the actual exit value, divide by 256, but not useful here 300 309 # possible tomcat was already stopped - it's not the end of the world 301 310 print STDERR "**** Failed to stop Fedora server. Perhaps it was not running. $!\n"; 311 print "Exit status = ", $status/256, "\n"; 302 312 } 303 313 … … 311 321 312 322 # c. Restart the fedora server 313 my $start_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "startup .sh");323 my $start_tomcat = &util::filename_cat($fedora_home, "tomcat", "bin", "startup".$script_ext); 314 324 $!=0; 315 if (system($start_tomcat)!=0) { 325 $status = system($start_tomcat); 326 if ($status!=0) { 316 327 print STDERR "Failed to restart the Fedora server... ERROR: $!\n"; 317 } 328 print "Exit status = ", $status/256, "\n"; 329 } 330 331 318 332 # QUESTION: 319 333 # Starting up the Fedora server takes a long time. How long should we wait before
Note:
See TracChangeset
for help on using the changeset viewer.