Changeset 31643 for main/trunk
- Timestamp:
- 2017-05-02T20:33:29+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/util/SafeProcess.java
r31642 r31643 129 129 } 130 130 } 131 } 131 } 132 132 133 133 return prcs; … … 253 253 254 254 if( this.forciblyTerminateProcess ) { 255 process.destroy(); // see runProcess() below 255 process.destroy(); // see runProcess() below 256 //killAnyPerl(); 256 257 } 257 258 process = null; … … 345 346 log("*** Going to call process.destroy 2"); 346 347 process.destroy(); 348 //killAnyPerl(); 347 349 log("*** Have called process.destroy 2"); 348 350 } … … 433 435 log("*** Going to call process.destroy 1"); 434 436 process.destroy(); 437 //killAnyPerl(); 435 438 log("*** Have called process.destroy 1"); 436 439 } … … 442 445 } 443 446 444 447 // stackoverflow.com/questions/1835885/send-ctrl-c-to-process-open-by-java 448 // (Taskkill command can kill all running perl. But what if we kill perl instances not launched by GS?) 449 // stackoverflow.com/questions/912889/how-to-send-interrupt-key-sequence-to-a-java-process 450 // Searching for: "forcibly terminate external process launched by Java on Windows" 451 static void killAnyPerl() { 452 if(!Utility.isWindows()) return; 453 454 // only on Windows do we need to still kill perl despite process.destroy() 455 try{ 456 Runtime.getRuntime().exec("taskkill /f /im perl.exe"); 457 } catch(Exception e) { 458 log("@@@ Exception attempting to stop perl " + e.getMessage(), e); 459 } 460 } 461 445 462 //******************** Inner class and interface definitions ********************// 446 463 // Static inner classes can be instantiated without having to instantiate an object of the outer class first
Note:
See TracChangeset
for help on using the changeset viewer.