Fixed a issue where executing an external process using the StaticUtils.exec method might never return. This will cause the server to dead lock when setting the file permissions using the UNIX chmod command. A particular case where this may happen is during log rotation on Java 5.
Fix for issue 2116
| | |
| | | import java.io.File; |
| | | import java.io.FileNotFoundException; |
| | | import java.lang.reflect.Method; |
| | | import java.util.ArrayList; |
| | | |
| | | import org.opends.server.core.DirectoryServer; |
| | | |
| | |
| | | f.getAbsolutePath() |
| | | }; |
| | | |
| | | ArrayList<String> outputLines = new ArrayList<String>(1); |
| | | int exitCode; |
| | | try |
| | | { |
| | | exitCode = exec("chmod", arguments, null, null, outputLines); |
| | | exitCode = exec("chmod", arguments, null, null, null); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.io.InputStream; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.nio.ByteBuffer; |
| | | import java.text.ParseException; |
| | |
| | | } |
| | | else |
| | | { |
| | | InputStream processStream = process.getInputStream(); |
| | | BufferedReader reader = |
| | | new BufferedReader(new InputStreamReader( |
| | | process.getInputStream())); |
| | | |
| | | try |
| | | { |
| | | while (true) |
| | | while (processStream.available() > 0) |
| | | { |
| | | String line = reader.readLine(); |
| | | if (line == null) |