Changeset 32050
- Timestamp:
- 2017-10-20T19:13:00+13:00 (7 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java
r32049 r32050 411 411 412 412 System.err.println("ShutDownHook called..."); 413 System.err.println("Attempting to forcibly terminate the GS server...");414 413 415 414 if (GS3) { // issue the ant call to stop any running GS3 416 415 // (tomcat and networked Derby Server) by calling GS3ServerThread.stopServer() 417 416 if(!GS3ServerThread.wasServerLaunchedOutsideGLI()) { 417 System.err.println("Attempting to forcibly terminate the GS server..."); 418 418 GS3ServerThread.stopServer(); 419 419 } else { … … 422 422 } else { // issue the call to stop any running GS2 local library server 423 423 if (LocalLibraryServer.isRunning() == true) { 424 System.err.println("Attempting to forcibly terminate the GS server..."); 424 425 LocalLibraryServer.forceStopServer(); 425 426 } … … 437 438 438 439 if(!GS3ServerThread.wasServerLaunchedOutsideGLI()) { 439 System.err.println("@@@@ Launching tomcat from GLI");440 //System.err.println("@@@@ Launching tomcat from GLI"); 440 441 GS3ServerThread thread = new GS3ServerThread(gsdl3_src_path, "restart"); 441 442 thread.start(); … … 820 821 //thread.start(); 821 822 if(!GS3ServerThread.wasServerLaunchedOutsideGLI()) { 822 System.err.println("@@@@ Off to call stopServer");823 823 GS3ServerThread.stopServer(); 824 824 } else { -
main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java
r32049 r32050 49 49 String _ant_command = ""; 50 50 51 // isIndependentServer is true/1 if tomcat was already running when GLI was started up 52 // in which case GLI doesn't need to ask tomcat to be run, nor does it need to stop the server on exit 53 // Value can be -1, 0 or 1. -1 means not yet determined. 0 is false, 1 is true 51 // isIndependentServer is true if tomcat was already running when GLI was started up 52 // in which case GLI doesn't need start tomcat itself, nor should it need to stop the server on exit 54 53 static private final boolean isIndependentServer = GS3ServerThread.isServerRunning(); 55 56 /*static {57 isIndependentServer = isServerRunning();58 }*/59 54 60 55 public GS3ServerThread(String gsdl3_src_path, String ant_command) … … 160 155 SafeProcess p = null; 161 156 if (Utility.isWindows()) { 162 // cmd /C "cd "C:\path\to\greenstone3" && ant stop"163 157 p = new SafeProcess("cmd /C \"cd \"" + Configuration.gsdl3_src_path + File.separator + "\" && "+antCmd+"\""); 164 158 } else { … … 166 160 } 167 161 168 System.err.println("**** Checking if tomcat is running");162 //System.err.println("**** Checking if tomcat is running"); 169 163 p.runProcess(); 170 164 String output = p.getStdOutput(); 171 165 172 166 if(output.contains("Tomcat is running: true")) { 173 System.err.println("**** Tomcat was running");167 //System.err.println("**** Tomcat was running"); 174 168 return true; 175 169 } 176 170 177 System.err.println("**** Tomcat was not running");171 //System.err.println("**** Tomcat was not running"); 178 172 return false; 179 173 } … … 181 175 // first time, call this on startup, before running GS3ServerThread 182 176 public static boolean wasServerLaunchedOutsideGLI() { 183 System.err.println("@@@ Was server launched outside GLI: " + isIndependentServer);177 //System.err.println("@@@ Was server launched outside GLI: " + isIndependentServer); 184 178 return isIndependentServer; 185 179 }
Note:
See TracChangeset
for help on using the changeset viewer.