- Timestamp:
- 2017-05-29T18:49:10+12:00 (7 years ago)
- Location:
- main/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/util/SafeProcess.java
r31707 r31712 917 917 /* 918 918 // On Macs (all Unix?) can't get the child processes of a process once it's been destroyed 919 macTerminateSubProcessesRecursively(pid, p); // pid, true)919 macTerminateSubProcessesRecursively(pid, p); 920 920 */ 921 921 922 922 if(pid == -1) { 923 p.destroy(); // at minimum , will have no effect if the process had already terminated923 p.destroy(); // at minimum. Will have no effect if the process had already terminated 924 924 } else { 925 925 boolean forceKill = true; … … 936 936 937 937 938 // UNUSED and INCOMPLETE 938 // UNUSED and INCOMPLETE METHOD 939 939 // But if this method is needed, then need to parse childpids printed by "pgrep -P pid" and write recursive step 940 940 // The childpids are probably listed one per line, see https://unix.stackexchange.com/questions/117227/why-pidof-and-pgrep-are-behaving-differently … … 1422 1422 1423 1423 public static void log(String msg, Exception e) { // Print stack trace on the exception 1424 if(DEBUG == 0) return;1425 1424 //logger.error(msg, e); 1426 1425 … … 1433 1432 1434 1433 public static void log(Exception e) { 1435 if(DEBUG == 0) return;1436 1434 //logger.error(e); 1437 1435 -
main/trunk/greenstone3/src/java/org/greenstone/util/SafeProcess.java
r31707 r31712 918 918 /* 919 919 // On Macs (all Unix?) can't get the child processes of a process once it's been destroyed 920 macTerminateSubProcessesRecursively(pid, p); // pid, true)920 macTerminateSubProcessesRecursively(pid, p); 921 921 */ 922 922 923 923 if(pid == -1) { 924 p.destroy(); // at minimum , will have no effect if the process had already terminated924 p.destroy(); // at minimum. Will have no effect if the process had already terminated 925 925 } else { 926 926 boolean forceKill = true; … … 937 937 938 938 939 // UNUSED and INCOMPLETE 939 // UNUSED and INCOMPLETE METHOD 940 940 // But if this method is needed, then need to parse childpids printed by "pgrep -P pid" and write recursive step 941 941 // The childpids are probably listed one per line, see https://unix.stackexchange.com/questions/117227/why-pidof-and-pgrep-are-behaving-differently … … 1423 1423 1424 1424 public static void log(String msg, Exception e) { // Print stack trace on the exception 1425 if(DEBUG == 0) return;1426 1425 logger.error(msg, e); 1427 1426 … … 1434 1433 1435 1434 public static void log(Exception e) { 1436 if(DEBUG == 0) return;1437 1435 logger.error(e); 1438 1436
Note:
See TracChangeset
for help on using the changeset viewer.