- Timestamp:
- 2017-07-21T18:37:30+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java
r24906 r31813 38 38 import org.greenstone.gatherer.Gatherer; 39 39 import org.greenstone.gatherer.util.PortFinder; 40 import org.greenstone.gatherer.util.SafeProcess; 40 41 import org.greenstone.gatherer.util.Utility; 41 42 … … 399 400 if (isPersistentServer) { 400 401 config(QUIT_COMMAND); 401 } else { 402 } else { 402 403 boolean success = sendMessageToServer("QUIT\n"); 403 404 try { … … 451 452 452 453 running = false; 454 } 455 456 // This method does the approximate equivalent of util.GSServerThread.stopServer() 457 // On unexpected, unnatural termination of GLI, call this to send the web-stop message the local library server to stop 458 static public void forceStopServer() { 459 SafeProcess p = null; 460 if (Utility.isWindows()) { 461 // cmd /C "cd "C:\path\to\greenstone3" && ant stop" 462 p = new SafeProcess("cmd /C \"cd \"" + Configuration.gsdl_path + File.separator + "\" && gsicontrol.bat web-stop\""); 463 } else { 464 p = new SafeProcess(new String[]{"/bin/bash", "-c", "cd \"" + Configuration.gsdl_path + "\" && ./gsicontrol.sh web-stop"}); 465 } 466 int result = p.runProcess(); 467 if(result == 0) { 468 System.err.println("Successfully stopped GS2 server."); 469 //DebugStream.println("********** SUCCESSFULLY stopped THE GS2 SERVER ON EXIT"); 470 } 471 else { 472 System.err.println("********** FAILED TO SUCCESSFULLY stop THE GS2 SERVER ON EXIT"); 473 } 474 p = null; 453 475 } 454 476
Note:
See TracChangeset
for help on using the changeset viewer.