This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.4.x in repository https://gitbox.apache.org/repos/asf/karaf.git
The following commit(s) were added to refs/heads/karaf-4.4.x by this push: new 2cffad038f Changed handling of the TCP connection to send the stop command and added a EOL character to the stream 2cffad038f is described below commit 2cffad038fb7519efc4d25629e79214756eda3e4 Author: Dieder Timmers die...@ratshome.net <Dieder Timmers die...@ratshome.net> AuthorDate: Tue Mar 21 14:47:46 2023 +0100 Changed handling of the TCP connection to send the stop command and added a EOL character to the stream (cherry picked from commit 50d92c1a5ae493dec1af7f621fed7523dc407c0f) --- main/src/main/java/org/apache/karaf/main/Stop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/org/apache/karaf/main/Stop.java b/main/src/main/java/org/apache/karaf/main/Stop.java index 2609ad6a73..1f231569d0 100644 --- a/main/src/main/java/org/apache/karaf/main/Stop.java +++ b/main/src/main/java/org/apache/karaf/main/Stop.java @@ -56,11 +56,13 @@ public class Stop { if (config.shutdownPort > 0) { try (Socket s = new Socket(config.shutdownHost, config.shutdownPort)) { s.getOutputStream().write(config.shutdownCommand.getBytes()); - System.exit(0); + s.getOutputStream().write('\n'); + s.getOutputStream().flush(); } catch (ConnectException connectException) { System.err.println("Can't connect to the container. The container is not running."); System.exit(1); } + System.exit(0); } else { // using the pid file int pid = getPidFromPidFile(config.pidFile);